From 858a9fa99fa8410b69523fa4ed69272015fcf0d3 Mon Sep 17 00:00:00 2001 From: TravisBot <> Date: Wed, 10 Jan 2018 18:45:08 +0000 Subject: [Travis] Rebuilding documentation --- README_8md.html | 38 +- active_8cpp.html | 44 +- active_8h.html | 44 +- active_8h_source.html | 42 +- annotated.html | 88 +- annotated.js | 5 - batch_8h.html | 54 +- batch_8h_source.html | 81 +- bc_s.png | Bin 676 -> 643 bytes bdwn.png | Bin 147 -> 148 bytes body_8cpp.html | 44 +- body_8h.html | 44 +- body_8h_source.html | 42 +- bug.html | 37 +- camera_8cpp.html | 44 +- camera_8h.html | 44 +- camera_8h_source.html | 42 +- classComponent.html | 106 + classes.html | 95 +- classyage_1_1Active-members.html | 41 +- classyage_1_1Active.html | 42 +- classyage_1_1Active.js | 9 - classyage_1_1Batch-members.html | 41 +- classyage_1_1Batch.html | 42 +- classyage_1_1Batch.js | 7 - classyage_1_1Body-members.html | 41 +- classyage_1_1Body.html | 42 +- classyage_1_1Body.js | 15 - classyage_1_1Body.png | Bin 1112 -> 1112 bytes classyage_1_1Camera-members.html | 41 +- classyage_1_1Camera.html | 44 +- classyage_1_1Camera.js | 7 - classyage_1_1Collider-members.html | 41 +- classyage_1_1Collider.html | 42 +- classyage_1_1Collider.js | 8 - classyage_1_1Collider.png | Bin 642 -> 642 bytes classyage_1_1CollisionBody-members.html | 41 +- classyage_1_1CollisionBody.html | 42 +- classyage_1_1CollisionBody.js | 5 - classyage_1_1CollisionBody.png | Bin 560 -> 560 bytes classyage_1_1Drawable-members.html | 41 +- classyage_1_1Drawable.html | 42 +- classyage_1_1Drawable.js | 4 - classyage_1_1Drawable.png | Bin 772 -> 772 bytes classyage_1_1Engine-members.html | 113 + classyage_1_1Engine.html | 237 + classyage_1_1Entity-members.html | 110 + classyage_1_1Entity.html | 170 + classyage_1_1EntityManager-members.html | 113 + classyage_1_1EntityManager.html | 260 + classyage_1_1ImageLoader-members.html | 41 +- classyage_1_1ImageLoader.html | 42 +- classyage_1_1ImageLoader.js | 4 - classyage_1_1IoManager-members.html | 41 +- classyage_1_1IoManager.html | 42 +- classyage_1_1IoManager.js | 4 - classyage_1_1LogMessage-members.html | 41 +- classyage_1_1LogMessage.html | 42 +- classyage_1_1LogMessage.js | 11 - classyage_1_1LogSink-members.html | 41 +- classyage_1_1LogSink.html | 42 +- classyage_1_1LogSink.js | 10 - classyage_1_1Logger-members.html | 41 +- classyage_1_1Logger.html | 60 +- classyage_1_1Logger.js | 14 - classyage_1_1Matrix-members.html | 41 +- classyage_1_1Matrix.html | 51 +- classyage_1_1Matrix.js | 18 - classyage_1_1ParticleBody-members.html | 41 +- classyage_1_1ParticleBody.html | 42 +- classyage_1_1ParticleBody.js | 6 - classyage_1_1ParticleBody.png | Bin 801 -> 801 bytes classyage_1_1Rectangle-members.html | 41 +- classyage_1_1Rectangle.html | 42 +- classyage_1_1Rectangle.js | 5 - classyage_1_1Rectangle.png | Bin 764 -> 764 bytes classyage_1_1RectangleCollider-members.html | 41 +- classyage_1_1RectangleCollider.html | 42 +- classyage_1_1RectangleCollider.js | 6 - classyage_1_1RectangleCollider.png | Bin 645 -> 645 bytes classyage_1_1ResourceManager-members.html | 41 +- classyage_1_1ResourceManager.html | 42 +- classyage_1_1ResourceManager.js | 4 - classyage_1_1RigidBody-members.html | 41 +- classyage_1_1RigidBody.html | 42 +- classyage_1_1RigidBody.js | 4 - classyage_1_1RigidBody.png | Bin 796 -> 796 bytes classyage_1_1Shader-members.html | 41 +- classyage_1_1Shader.html | 42 +- classyage_1_1Shader.js | 13 - classyage_1_1Shape-members.html | 41 +- classyage_1_1Shape.html | 42 +- classyage_1_1Shape.js | 4 - classyage_1_1Shape.png | Bin 767 -> 767 bytes classyage_1_1Space-members.html | 110 + classyage_1_1Space.html | 167 + classyage_1_1Sprite-members.html | 41 +- classyage_1_1Sprite.html | 42 +- classyage_1_1Sprite.js | 11 - classyage_1_1SpriteBatch-members.html | 41 +- classyage_1_1SpriteBatch.html | 42 +- classyage_1_1SpriteBatch.js | 14 - classyage_1_1SpriteSheet-members.html | 41 +- classyage_1_1SpriteSheet.html | 42 +- classyage_1_1SpriteSheet.js | 6 - classyage_1_1SyncQueue-members.html | 41 +- classyage_1_1SyncQueue.html | 42 +- classyage_1_1SyncQueue.js | 10 - classyage_1_1System-members.html | 111 + classyage_1_1System.html | 218 + classyage_1_1TextureCache-members.html | 41 +- classyage_1_1TextureCache.html | 42 +- classyage_1_1TextureCache.js | 6 - classyage_1_1Vector-members.html | 41 +- classyage_1_1Vector.html | 42 +- classyage_1_1Vector.js | 9 - classyage_1_1Vector.png | Bin 799 -> 799 bytes classyage_1_1Vector2-members.html | 41 +- classyage_1_1Vector2.html | 42 +- classyage_1_1Vector2.js | 11 - classyage_1_1Vector2.png | Bin 1115 -> 1115 bytes classyage_1_1Vector3-members.html | 41 +- classyage_1_1Vector3.html | 42 +- classyage_1_1Vector3.js | 12 - classyage_1_1Vector3.png | Bin 1113 -> 1113 bytes classyage_1_1Vector4-members.html | 41 +- classyage_1_1Vector4.html | 42 +- classyage_1_1Vector4.js | 14 - classyage_1_1Vector4.png | Bin 1116 -> 1116 bytes classyage_1_1Window-members.html | 41 +- classyage_1_1Window.html | 42 +- classyage_1_1Window.js | 17 - classyage_1_1details_1_1Row-members.html | 41 +- classyage_1_1details_1_1Row.html | 42 +- classyage_1_1details_1_1Row.js | 6 - closed.png | Bin 132 -> 133 bytes collider_8h.html | 44 +- collider_8h_source.html | 42 +- collisionbody_8h.html | 44 +- collisionbody_8h_source.html | 42 +- component_8h.html | 156 + component_8h_source.html | 121 + deprecated.html | 37 +- dir_059f34b87ae2c2af887b23a7e5e8e88f.html | 54 +- dir_059f34b87ae2c2af887b23a7e5e8e88f.js | 31 - dir_0a5be4b85c8e2c05f7a9f5a803f53125.html | 44 +- dir_0a5be4b85c8e2c05f7a9f5a803f53125.js | 11 - dir_11841e5da2063fc5766a682aee38e289.html | 42 +- dir_11841e5da2063fc5766a682aee38e289.js | 39 - dir_4360c3054e876104aec8d81523b584e2.html | 141 + dir_48a91ae829881cbedcfc124d2027890d.html | 42 +- dir_48a91ae829881cbedcfc124d2027890d.js | 10 - dir_a58d7658bbcfd3d3d7296185ebe55c28.html | 42 +- dir_a58d7658bbcfd3d3d7296185ebe55c28.js | 26 - dir_aa7f86daaaa64c448f636c0e65de2cec.html | 42 +- dir_aa7f86daaaa64c448f636c0e65de2cec.js | 4 - dir_d09e80fdcf0bb585bbe3b7099c52d028.html | 42 +- dir_d09e80fdcf0bb585bbe3b7099c52d028.js | 13 - doxygen.css | 130 +- doxygen.png | Bin 3779 -> 3853 bytes drawable_8h.html | 54 +- drawable_8h_source.html | 77 +- ellipse_8h.html | 52 +- ellipse_8h_source.html | 53 +- engine_8cpp.html | 121 + engine_8h.html | 132 + engine_8h_source.html | 146 + entity_8cpp.html | 122 + entity_8h.html | 130 + entity_8h_source.html | 131 + entitymanager_8cpp.html | 121 + entitymanager_8h.html | 131 + entitymanager_8h_source.html | 147 + files.html | 128 +- files.js | 4 - ftv2cl.png | Bin 453 -> 459 bytes ftv2doc.png | Bin 746 -> 799 bytes ftv2folderclosed.png | Bin 616 -> 659 bytes ftv2folderopen.png | Bin 597 -> 656 bytes ftv2link.png | Bin 746 -> 799 bytes ftv2mlastnode.png | Bin 246 -> 246 bytes ftv2mnode.png | Bin 246 -> 246 bytes ftv2mo.png | Bin 403 -> 389 bytes ftv2ns.png | Bin 388 -> 384 bytes ftv2plastnode.png | Bin 229 -> 234 bytes ftv2pnode.png | Bin 229 -> 234 bytes ftv2splitbar.png | Bin 314 -> 304 bytes functions.html | 38 +- functions_b.html | 35 +- functions_c.html | 44 +- functions_d.html | 35 +- functions_dup.js | 28 - functions_e.html | 41 +- functions_f.html | 35 +- functions_func.html | 72 +- functions_g.html | 38 +- functions_h.html | 35 +- functions_i.html | 40 +- functions_k.html | 35 +- functions_l.html | 35 +- functions_m.html | 40 +- functions_n.html | 35 +- functions_o.html | 35 +- functions_p.html | 35 +- functions_r.html | 35 +- functions_rela.html | 35 +- functions_s.html | 40 +- functions_t.html | 35 +- functions_type.html | 35 +- functions_u.html | 37 +- functions_v.html | 35 +- functions_vars.html | 35 +- functions_w.html | 35 +- functions_x.html | 35 +- functions_y.html | 35 +- functions_z.html | 35 +- functions_~.html | 38 +- globals.html | 60 +- globals_defs.html | 36 +- globals_enum.html | 111 + globals_eval.html | 42 +- globals_func.html | 36 +- globals_type.html | 36 +- globals_vars.html | 36 +- hierarchy.html | 120 +- hierarchy.js | 63 - imageloader_8cpp.html | 44 +- imageloader_8h.html | 44 +- imageloader_8h_source.html | 42 +- index.html | 58 +- input_8h.html | 44 +- input_8h.js | 128 - input_8h_source.html | 42 +- iomanager_8cpp.html | 44 +- iomanager_8h.html | 44 +- iomanager_8h_source.html | 42 +- jquery.js | 41 - logger_8cpp.html | 44 +- logger_8dox.html | 123 - logger_8h.html | 46 +- logger_8h.js | 10 - logger_8h_source.html | 77 +- logger_8md.html | 99 + logger_guide.html | 103 + loglevel_8h.html | 45 +- loglevel_8h.js | 10 - loglevel_8h_source.html | 84 +- logmessage_8cpp.html | 44 +- logmessage_8h.html | 44 +- logmessage_8h_source.html | 87 +- logsink_8cpp.html | 44 +- logsink_8cpp.js | 7 - logsink_8h.html | 44 +- logsink_8h.js | 7 - logsink_8h_source.html | 42 +- main_8md.html | 99 + matrix_8dox.html | 123 - matrix_8h.html | 44 +- matrix_8h.js | 33 - matrix_8h_source.html | 42 +- matrix_8md.html | 99 + matrix_guide.html | 101 + md_README.html | 109 + md_docs_todolist.html | 108 + md_yage_physics_README.html | 37 +- namespacemembers.html | 37 +- namespacemembers_enum.html | 35 +- namespacemembers_eval.html | 35 +- namespacemembers_func.html | 37 +- namespacemembers_type.html | 35 +- namespaces.html | 37 +- namespaces.js | 4 - namespaceyage.html | 94 +- namespaceyage.js | 40 - namespaceyage_1_1details.html | 42 +- namespaceyage_1_1details.js | 7 - namespaceyage_1_1matrix.html | 44 +- nav_f.png | Bin 153 -> 144 bytes nav_h.png | Bin 98 -> 101 bytes navtree.css | 143 - navtree.js | 567 - navtreeindex0.js | 253 - navtreeindex1.js | 253 - navtreeindex2.js | 153 - open.png | Bin 123 -> 123 bytes pages.html | 48 +- particlebody_8cpp.html | 44 +- particlebody_8h.html | 44 +- particlebody_8h_source.html | 42 +- physics_8h.html | 42 +- physics_8h_source.html | 42 +- rectangle_8cpp.html | 54 +- rectangle_8h.html | 54 +- rectangle_8h_source.html | 99 +- rectanglecollider_8cpp.html | 44 +- rectanglecollider_8h.html | 44 +- rectanglecollider_8h_source.html | 42 +- resize.js | 97 - resourcemanager_8cpp.html | 44 +- resourcemanager_8h.html | 44 +- resourcemanager_8h_source.html | 42 +- rigidbody_8cpp.html | 44 +- rigidbody_8h.html | 44 +- rigidbody_8h_source.html | 42 +- search/all_0.js | 4 +- search/all_12.js | 17 +- search/all_13.js | 2 +- search/all_14.js | 2 +- search/all_18.js | 1 + search/all_1a.js | 1 + search/all_2.js | 11 +- search/all_4.js | 11 + search/all_6.js | 5 +- search/all_8.js | 4 +- search/all_b.js | 3 +- search/all_c.js | 7 +- search/all_d.js | 1 + search/all_f.js | 2 +- search/classes_2.js | 1 + search/classes_4.js | 4 +- search/classes_5.js | 3 +- search/classes_6.js | 5 +- search/classes_7.js | 7 +- search/classes_8.js | 6 +- search/classes_9.js | 8 +- search/classes_a.js | 14 +- search/classes_b.js | 12 +- search/classes_c.js | 3 +- search/classes_d.js | 11 +- search/classes_e.js | 11 +- search/classes_f.html | 26 + search/classes_f.js | 4 + search/enums_0.js | 2 +- search/enums_1.js | 2 +- search/enums_2.js | 2 +- search/enums_3.html | 26 + search/enums_3.js | 4 + search/enumvalues_d.js | 1 + search/enumvalues_f.js | 1 + search/files_2.js | 3 +- search/files_4.js | 8 +- search/files_6.js | 2 +- search/files_7.js | 5 +- search/files_a.js | 6 +- search/files_b.js | 2 +- search/functions_0.js | 1 + search/functions_10.js | 1 + search/functions_12.js | 2 +- search/functions_18.js | 1 + search/functions_2.js | 4 +- search/functions_4.js | 4 +- search/functions_6.js | 3 +- search/functions_8.js | 4 +- search/functions_b.js | 1 + search/pages_0.js | 2 +- search/pages_1.js | 2 +- search/pages_2.js | 2 +- search/pages_3.js | 2 +- search/pages_4.js | 2 +- search/pages_5.html | 26 + search/pages_5.js | 4 + search/pages_6.html | 26 + search/pages_6.js | 4 + search/pages_7.html | 26 + search/pages_7.js | 4 + search/pages_8.html | 26 + search/pages_8.js | 5 + search/search.css | 14 +- search/search.js | 6 +- shader_8cpp.html | 44 +- shader_8h.html | 48 +- shader_8h_source.html | 46 +- shape_8h.html | 54 +- shape_8h_source.html | 81 +- space_8cpp.html | 121 + space_8h.html | 131 + space_8h_source.html | 137 + sprite_8cpp.html | 44 +- sprite_8h.html | 44 +- sprite_8h_source.html | 42 +- spritebatch_8cpp.html | 44 +- spritebatch_8h.html | 44 +- spritebatch_8h_source.html | 44 +- spritebatch_8md.html | 99 + spritebatch_guide.html | 93 + spritesheet_8cpp.html | 44 +- spritesheet_8h.html | 44 +- spritesheet_8h.js | 6 - spritesheet_8h_source.html | 42 +- stb__image_8cpp.html | 42 +- stb__image_8cpp.js | 4 - stb__image_8h.html | 42 +- stb__image_8h.js | 48 - stb__image_8h_source.html | 14994 +++++++++++--------- structstbi__io__callbacks-members.html | 37 +- structstbi__io__callbacks.html | 38 +- structstbi__io__callbacks.js | 6 - structyage_1_1Colour-members.html | 41 +- structyage_1_1Colour.html | 42 +- structyage_1_1Colour.js | 9 - structyage_1_1LogMessage_1_1Meta-members.html | 41 +- structyage_1_1LogMessage_1_1Meta.html | 42 +- structyage_1_1LogMessage_1_1Meta.js | 6 - structyage_1_1Position-members.html | 41 +- structyage_1_1Position.html | 42 +- structyage_1_1Position.js | 7 - structyage_1_1Texture-members.html | 41 +- structyage_1_1Texture.html | 42 +- structyage_1_1Texture.js | 10 - structyage_1_1UV-members.html | 41 +- structyage_1_1UV.html | 42 +- structyage_1_1UV.js | 7 - structyage_1_1Vertex-members.html | 41 +- structyage_1_1Vertex.html | 42 +- structyage_1_1Vertex.js | 11 - structyage_1_1details_1_1Coordinate-members.html | 41 +- structyage_1_1details_1_1Coordinate.html | 42 +- structyage_1_1details_1_1Coordinate.js | 9 - structyage_1_1details_1_1Glyph-members.html | 41 +- structyage_1_1details_1_1Glyph.html | 42 +- structyage_1_1details_1_1Glyph.js | 10 - structyage_1_1details_1_1RenderBatch-members.html | 41 +- structyage_1_1details_1_1RenderBatch.html | 42 +- structyage_1_1details_1_1RenderBatch.js | 7 - sync_off.png | Bin 853 -> 847 bytes sync_on.png | Bin 845 -> 836 bytes syncqueue_8h.html | 44 +- syncqueue_8h_source.html | 42 +- system_8h.html | 129 + system_8h_source.html | 129 + tab_a.png | Bin 142 -> 145 bytes tab_b.png | Bin 169 -> 172 bytes tab_h.png | Bin 177 -> 171 bytes tab_s.png | Bin 184 -> 178 bytes tabs.css | 2 +- texture_8h.html | 44 +- texture_8h_source.html | 42 +- texturecache_8cpp.html | 44 +- texturecache_8h.html | 44 +- texturecache_8h_source.html | 42 +- todo.html | 43 +- todolist_8dox.html | 123 - todolist_8md.html | 99 + vertex_8h.html | 44 +- vertex_8h_source.html | 42 +- window_8cpp.html | 46 +- window_8h.html | 44 +- window_8h.js | 10 - window_8h_source.html | 58 +- yage.png | Bin 0 -> 3333 bytes yage_2physics_2README_8md.html | 38 +- yage_8cpp.html | 52 +- yage_8cpp.js | 6 - yage_8h.html | 55 +- yage_8h.js | 6 - yage_8h_source.html | 117 +- 456 files changed, 16422 insertions(+), 17519 deletions(-) delete mode 100644 annotated.js create mode 100644 classComponent.html delete mode 100644 classyage_1_1Active.js delete mode 100644 classyage_1_1Batch.js delete mode 100644 classyage_1_1Body.js delete mode 100644 classyage_1_1Camera.js delete mode 100644 classyage_1_1Collider.js delete mode 100644 classyage_1_1CollisionBody.js delete mode 100644 classyage_1_1Drawable.js create mode 100644 classyage_1_1Engine-members.html create mode 100644 classyage_1_1Engine.html create mode 100644 classyage_1_1Entity-members.html create mode 100644 classyage_1_1Entity.html create mode 100644 classyage_1_1EntityManager-members.html create mode 100644 classyage_1_1EntityManager.html delete mode 100644 classyage_1_1ImageLoader.js delete mode 100644 classyage_1_1IoManager.js delete mode 100644 classyage_1_1LogMessage.js delete mode 100644 classyage_1_1LogSink.js delete mode 100644 classyage_1_1Logger.js delete mode 100644 classyage_1_1Matrix.js delete mode 100644 classyage_1_1ParticleBody.js delete mode 100644 classyage_1_1Rectangle.js delete mode 100644 classyage_1_1RectangleCollider.js delete mode 100644 classyage_1_1ResourceManager.js delete mode 100644 classyage_1_1RigidBody.js delete mode 100644 classyage_1_1Shader.js delete mode 100644 classyage_1_1Shape.js create mode 100644 classyage_1_1Space-members.html create mode 100644 classyage_1_1Space.html delete mode 100644 classyage_1_1Sprite.js delete mode 100644 classyage_1_1SpriteBatch.js delete mode 100644 classyage_1_1SpriteSheet.js delete mode 100644 classyage_1_1SyncQueue.js create mode 100644 classyage_1_1System-members.html create mode 100644 classyage_1_1System.html delete mode 100644 classyage_1_1TextureCache.js delete mode 100644 classyage_1_1Vector.js delete mode 100644 classyage_1_1Vector2.js delete mode 100644 classyage_1_1Vector3.js delete mode 100644 classyage_1_1Vector4.js delete mode 100644 classyage_1_1Window.js delete mode 100644 classyage_1_1details_1_1Row.js create mode 100644 component_8h.html create mode 100644 component_8h_source.html delete mode 100644 dir_059f34b87ae2c2af887b23a7e5e8e88f.js delete mode 100644 dir_0a5be4b85c8e2c05f7a9f5a803f53125.js delete mode 100644 dir_11841e5da2063fc5766a682aee38e289.js create mode 100644 dir_4360c3054e876104aec8d81523b584e2.html delete mode 100644 dir_48a91ae829881cbedcfc124d2027890d.js delete mode 100644 dir_a58d7658bbcfd3d3d7296185ebe55c28.js delete mode 100644 dir_aa7f86daaaa64c448f636c0e65de2cec.js delete mode 100644 dir_d09e80fdcf0bb585bbe3b7099c52d028.js create mode 100644 engine_8cpp.html create mode 100644 engine_8h.html create mode 100644 engine_8h_source.html create mode 100644 entity_8cpp.html create mode 100644 entity_8h.html create mode 100644 entity_8h_source.html create mode 100644 entitymanager_8cpp.html create mode 100644 entitymanager_8h.html create mode 100644 entitymanager_8h_source.html delete mode 100644 files.js delete mode 100644 functions_dup.js create mode 100644 globals_enum.html delete mode 100644 hierarchy.js delete mode 100644 input_8h.js delete mode 100644 logger_8dox.html delete mode 100644 logger_8h.js create mode 100644 logger_8md.html create mode 100644 logger_guide.html delete mode 100644 loglevel_8h.js delete mode 100644 logsink_8cpp.js delete mode 100644 logsink_8h.js create mode 100644 main_8md.html delete mode 100644 matrix_8dox.html delete mode 100644 matrix_8h.js create mode 100644 matrix_8md.html create mode 100644 matrix_guide.html create mode 100644 md_README.html create mode 100644 md_docs_todolist.html delete mode 100644 namespaces.js delete mode 100644 namespaceyage.js delete mode 100644 namespaceyage_1_1details.js delete mode 100644 navtree.css delete mode 100644 navtree.js delete mode 100644 navtreeindex0.js delete mode 100644 navtreeindex1.js delete mode 100644 navtreeindex2.js delete mode 100644 resize.js create mode 100644 search/classes_f.html create mode 100644 search/classes_f.js create mode 100644 search/enums_3.html create mode 100644 search/enums_3.js create mode 100644 search/pages_5.html create mode 100644 search/pages_5.js create mode 100644 search/pages_6.html create mode 100644 search/pages_6.js create mode 100644 search/pages_7.html create mode 100644 search/pages_7.js create mode 100644 search/pages_8.html create mode 100644 search/pages_8.js create mode 100644 space_8cpp.html create mode 100644 space_8h.html create mode 100644 space_8h_source.html create mode 100644 spritebatch_8md.html create mode 100644 spritebatch_guide.html delete mode 100644 spritesheet_8h.js delete mode 100644 stb__image_8cpp.js delete mode 100644 stb__image_8h.js delete mode 100644 structstbi__io__callbacks.js delete mode 100644 structyage_1_1Colour.js delete mode 100644 structyage_1_1LogMessage_1_1Meta.js delete mode 100644 structyage_1_1Position.js delete mode 100644 structyage_1_1Texture.js delete mode 100644 structyage_1_1UV.js delete mode 100644 structyage_1_1Vertex.js delete mode 100644 structyage_1_1details_1_1Coordinate.js delete mode 100644 structyage_1_1details_1_1Glyph.js delete mode 100644 structyage_1_1details_1_1RenderBatch.js create mode 100644 system_8h.html create mode 100644 system_8h_source.html delete mode 100644 todolist_8dox.html create mode 100644 todolist_8md.html delete mode 100644 window_8h.js create mode 100644 yage.png delete mode 100644 yage_8cpp.js delete mode 100644 yage_8h.js diff --git a/README_8md.html b/README_8md.html index 575135b6..da18960c 100644 --- a/README_8md.html +++ b/README_8md.html @@ -8,13 +8,6 @@ - - - - -
+
README.md File Reference
- - + diff --git a/active_8cpp.html b/active_8cpp.html index d4aec7b0..a5780c7b 100644 --- a/active_8cpp.html +++ b/active_8cpp.html @@ -8,13 +8,6 @@ - - - - -
+ +
Namespaces
@@ -119,7 +103,7 @@ $(document).ready(function(){initNavTree('active_8cpp.html','');});

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -127,15 +111,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/active_8h.html b/active_8h.html index 24dcc8c2..f6ba00bf 100644 --- a/active_8h.html +++ b/active_8h.html @@ -8,13 +8,6 @@ - - - - -
+ +
Classes | @@ -130,7 +114,7 @@ Classes

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -138,15 +122,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/active_8h_source.html b/active_8h_source.html index 79e7f98d..9ce9c03e 100644 --- a/active_8h_source.html +++ b/active_8h_source.html @@ -8,13 +8,6 @@ - - - - -
+ +
active.h
@@ -156,15 +140,11 @@ $(document).ready(function(){initNavTree('active_8h_source.html','');});
- - + diff --git a/annotated.html b/annotated.html index 18365dd4..4af6d9bb 100644 --- a/annotated.html +++ b/annotated.html @@ -8,13 +8,6 @@ - - - - -
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 123]
- + @@ -122,8 +102,7 @@ $(document).ready(function(){initNavTree('annotated.html','');}); - + @@ -136,38 +115,41 @@ $(document).ready(function(){initNavTree('annotated.html','');}); - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
oNyageProject namespace
oNyageCore includes
|oNdetails
||oCCoordinate
||oCRow
|oCCamera
|oCImageLoader
|oCIoManager
|oCLogger

Logger

-
|oCLogger
|oCLogMessage
||\CMeta
|oCLogSink
|oCColour
|oCUV
|oCVertex
|oCMatrixBase Matrix class used by other similar classes
|oCVector
|oCVector22D Vector class
|oCVector33D Vector class
|oCVector44D Vector class
|oCBody
|oCCollider
|oCCollisionBody
|oCParticleBody
|oCRectangleCollider
|oCRigidBody
|oCBatchWill be the base class for all the different batching processes that might use different shaders and attributes
|oCDrawable
|oCRectangle
|oCShader
|oCShape
|oCSprite
|oCSpriteBatch
|oCActive
|\CSyncQueue
\Cstbi_io_callbacks
|oCEngineMain engine class that contains a systems, the main loop and the update function that updates all the systems
|oCEntityEntity convenience class
|oCEntityManagerManages entities in a space
|oCSpaceSpace that keeps track of all the entities, componenets and runs the systems on the data to update them
|oCSystemSystem interface for the different systems in the engine
|oCMatrixBase Matrix class used by other similar classes
|oCVector
|oCVector22D Vector class
|oCVector33D Vector class
|oCVector44D Vector class
|oCBody
|oCCollider
|oCCollisionBody
|oCParticleBody
|oCRectangleCollider
|oCRigidBody
|oCBatchWill be the base class for all the different batching processes that might use different shaders and attributes
|oCDrawable
|oCRectangle
|oCShader
|oCShape
|oCSprite
|oCSpriteBatch
|oCActive
|\CSyncQueue
oCComponent
\Cstbi_io_callbacks
-
- + diff --git a/annotated.js b/annotated.js deleted file mode 100644 index 48ccda6f..00000000 --- a/annotated.js +++ /dev/null @@ -1,5 +0,0 @@ -var annotated = -[ - [ "yage", "namespaceyage.html", "namespaceyage" ], - [ "stbi_io_callbacks", "structstbi__io__callbacks.html", "structstbi__io__callbacks" ] -]; \ No newline at end of file diff --git a/batch_8h.html b/batch_8h.html index ffdfe903..d79d499f 100644 --- a/batch_8h.html +++ b/batch_8h.html @@ -8,13 +8,6 @@ - - - - -
+ +
Classes | @@ -112,6 +96,10 @@ $(document).ready(function(){initNavTree('batch_8h.html','');});
+


+ +More...

+

Go to the source code of this file.

- +

@@ -123,19 +111,19 @@ Classes

Namespaces

 yage
 Project namespace.
 Core includes.
 
-
-
+

Detailed Description

+

+

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

+

MIT License, see LICENSE file for more details.

+
- + diff --git a/batch_8h_source.html b/batch_8h_source.html index 3c97b55f..dfef1fa5 100644 --- a/batch_8h_source.html +++ b/batch_8h_source.html @@ -8,13 +8,6 @@ - - - - -
+ +
batch.h
-Go to the documentation of this file.
1 #ifndef YAGE_CORE_BATCH_H
-
2 #define YAGE_CORE_BATCH_H
-
3 
-
4 namespace yage
-
5 {
-
6 
-
25 class Batch
-
26 {
-
27 public:
-
28  virtual bool init();
-
29  virtual void begin();
-
30  virtual void end();
-
31  virtual void render();
-
32 };
-
33 
-
34 } // namespace yage
-
35 
-
36 #endif
+Go to the documentation of this file.
1 
+
9 #ifndef YAGE_CORE_BATCH_H
+
10 #define YAGE_CORE_BATCH_H
+
11 
+
12 namespace yage
+
13 {
+
14 
+
33 class Batch
+
34 {
+
35 public:
+
36  virtual bool init();
+
37  virtual void begin();
+
38  virtual void end();
+
39  virtual void render();
+
40 };
+
41 
+
42 } // namespace yage
+
43 
+
44 #endif
virtual void begin()
-
The Batch class will be the base class for all the different batching processes that might use differ...
Definition: batch.h:25
+
The Batch class will be the base class for all the different batching processes that might use differ...
Definition: batch.h:33
virtual bool init()
virtual void render()
virtual void end()
-
- + diff --git a/bc_s.png b/bc_s.png index 224b29aa..fa6edc0c 100644 Binary files a/bc_s.png and b/bc_s.png differ diff --git a/bdwn.png b/bdwn.png index 940a0b95..7e7c893b 100644 Binary files a/bdwn.png and b/bdwn.png differ diff --git a/body_8cpp.html b/body_8cpp.html index f18f6e40..80f9f1af 100644 --- a/body_8cpp.html +++ b/body_8cpp.html @@ -8,13 +8,6 @@ - - - - -
+ +
Namespaces
@@ -120,7 +104,7 @@ $(document).ready(function(){initNavTree('body_8cpp.html','');});

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -128,15 +112,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/body_8h.html b/body_8h.html index bdaadacf..ded4734d 100644 --- a/body_8h.html +++ b/body_8h.html @@ -8,13 +8,6 @@ - - - - -
+ +
Classes | @@ -127,7 +111,7 @@ Classes

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -135,15 +119,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/body_8h_source.html b/body_8h_source.html index 2265936a..ea4a1dd9 100644 --- a/body_8h_source.html +++ b/body_8h_source.html @@ -8,13 +8,6 @@ - - - - -
+ +
body.h
@@ -176,15 +160,11 @@ $(document).ready(function(){initNavTree('body_8h_source.html','');});
virtual void update()=0
Vector2d position_
Definition: body.h:25
- - + diff --git a/bug.html b/bug.html index 259593c5..61a327ee 100644 --- a/bug.html +++ b/bug.html @@ -8,13 +8,6 @@ - - - - -
+
Bug List
@@ -107,14 +87,11 @@ $(document).ready(function(){initNavTree('bug.html','');});
When printing certain matrices, it omits a row or column. Still need to determine under which conditions.
- - + diff --git a/camera_8cpp.html b/camera_8cpp.html index 1d0c5f4a..46a379ed 100644 --- a/camera_8cpp.html +++ b/camera_8cpp.html @@ -8,13 +8,6 @@ - - - - -
+ +
Namespaces
@@ -123,7 +107,7 @@ $(document).ready(function(){initNavTree('camera_8cpp.html','');});

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -131,15 +115,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/camera_8h.html b/camera_8h.html index 611acfb7..bb5b8893 100644 --- a/camera_8h.html +++ b/camera_8h.html @@ -8,13 +8,6 @@ - - - - -
+ +
Classes | @@ -127,7 +111,7 @@ Classes

Namespaces

 yage - Project namespace.
+ Core includes.
 

Detailed Description

@@ -135,15 +119,11 @@ Namespaces

Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

MIT License, see LICENSE file for more details.

- - + diff --git a/camera_8h_source.html b/camera_8h_source.html index c1e18ce2..fc575533 100644 --- a/camera_8h_source.html +++ b/camera_8h_source.html @@ -8,13 +8,6 @@ - - - - -
+ +
camera.h
@@ -146,15 +130,11 @@ $(document).ready(function(){initNavTree('camera_8h_source.html','');});
void move(const glm::vec2 &direction)
Moves the camera using a two-dimensional displacement vector to describe the movement.
Definition: camera.cpp:66
void update(Shader &program)
Updates the camera matrix value in the shader program that is passed to it.
Definition: camera.cpp:44
- - + diff --git a/classComponent.html b/classComponent.html new file mode 100644 index 00000000..d847a81d --- /dev/null +++ b/classComponent.html @@ -0,0 +1,106 @@ + + + + + + +YAGE: Component Class Reference + + + + + + + + + +
+
+ + + + + + + +
+
YAGE +  v0.1.4.0 +
+
Yet Another Game Engine
+
+
+ + + + + + +
+ All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
+ + +
+ +
+ +
+
+
+
Component Class Reference
+
+
+ +

#include <component.h>

+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classes.html b/classes.html index d8b67aae..17e526d1 100644 --- a/classes.html +++ b/classes.html @@ -8,13 +8,6 @@ - - - - -
Class Index
-
A | B | C | D | G | I | L | M | P | R | S | T | U | V | W
+
A | B | C | D | E | G | I | L | M | P | R | S | T | U | V | W
- - - - - - + + + + + - - - - - - + + + + + + + - - + + +
  A  
-
  G  
-
LogMessage::Meta (yage)   Shape (yage)   Vector2 (yage)   
  P  
-
Sprite (yage)   Vector3 (yage)   
Active (yage)   Glyph (yage::details)   SpriteBatch (yage)   Vector4 (yage)   
  B  
-
  I  
-
ParticleBody (yage)   SpriteSheet (yage)   Vertex (yage)   
Position (yage)   SyncQueue (yage)   
  W  
+
  E  
+
LogSink (yage)   Row (yage::details)   
  V  
Batch (yage)   ImageLoader (yage)   
  R  
-
  T  
+
  M  
+
  S  
Body (yage)   IoManager (yage)   Window (yage)   
Active (yage)   Engine (yage)   Vector (yage)   
  B  
+
Entity (yage)   Matrix (yage)   Shader (yage)   Vector2 (yage)   
EntityManager (yage)   LogMessage::Meta (yage)   Shape (yage)   Vector3 (yage)   
Batch (yage)   
  G  
+
  P  
+
Space (yage)   Vector4 (yage)   
Body (yage)   Sprite (yage)   Vertex (yage)   
  C  
-
  L  
-
Rectangle (yage)   Texture (yage)   
  s  
+
Glyph (yage::details)   ParticleBody (yage)   SpriteBatch (yage)   
  W  
RectangleCollider (yage)   TextureCache (yage)   
Camera (yage)   Logger (yage)   RenderBatch (yage::details)   
  U  
-
stbi_io_callbacks   
Collider (yage)   LogMessage (yage)   ResourceManager (yage)   
CollisionBody (yage)   LogSink (yage)   RigidBody (yage)   UV (yage)   
Colour (yage)   
  M  
-
Row (yage::details)   
  V  
-
Coordinate (yage::details)   
  S  
-
  I  
+
Position (yage)   SpriteSheet (yage)   
Camera (yage)   
  R  
+
SyncQueue (yage)   Window (yage)   
Collider (yage)   ImageLoader (yage)   System (yage)   
  s  
+
CollisionBody (yage)   IoManager (yage)   Rectangle (yage)   
  T  
+
Colour (yage)   
  L  
+
RectangleCollider (yage)   stbi_io_callbacks   
Component   RenderBatch (yage::details)   Texture (yage)   
Coordinate (yage::details)   Logger (yage)   ResourceManager (yage)   TextureCache (yage)   
  D  
-
Matrix (yage)   Vector (yage)   
Shader (yage)   
Drawable (yage)   
LogMessage (yage)   RigidBody (yage)   
  U  
+
Drawable (yage)   UV (yage)   
-
A | B | C | D | G | I | L | M | P | R | S | T | U | V | W
+
A | B | C | D | E | G | I | L | M | P | R | S | T | U | V | W
- - + diff --git a/classyage_1_1Active-members.html b/classyage_1_1Active-members.html index e470f033..eac0433e 100644 --- a/classyage_1_1Active-members.html +++ b/classyage_1_1Active-members.html @@ -8,13 +8,6 @@ - - - - -
+ +
yage::Active Member List
@@ -120,14 +104,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Active.html','');}); send(Callback message)yage::Active ~Active()yage::Active
- - + diff --git a/classyage_1_1Active.html b/classyage_1_1Active.html index daa3d377..355e4d32 100644 --- a/classyage_1_1Active.html +++ b/classyage_1_1Active.html @@ -8,13 +8,6 @@ - - - - -
+ +
Public Types | @@ -261,15 +245,11 @@ Static Public Member Functions
  • yage/util/active.cpp
  • -
    - + diff --git a/classyage_1_1Active.js b/classyage_1_1Active.js deleted file mode 100644 index 8b1c7418..00000000 --- a/classyage_1_1Active.js +++ /dev/null @@ -1,9 +0,0 @@ -var classyage_1_1Active = -[ - [ "Callback", "classyage_1_1Active.html#a4b82fec6f02c00d186b1b840ce8f11dc", null ], - [ "Active", "classyage_1_1Active.html#a7cd7344f0b8b7aa93ac0449e2fbbf7bd", null ], - [ "~Active", "classyage_1_1Active.html#ab69d08cf4804b59ac9db283015e749f2", null ], - [ "create", "classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064", null ], - [ "operator=", "classyage_1_1Active.html#add837044e73e4bc9849f09495535600c", null ], - [ "send", "classyage_1_1Active.html#a665673b94eb5ce7c448839e5bb6e0326", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Batch-members.html b/classyage_1_1Batch-members.html index 851b7361..03c16360 100644 --- a/classyage_1_1Batch-members.html +++ b/classyage_1_1Batch-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Batch Member List
    @@ -118,14 +102,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Batch.html','');}); init()yage::Batchvirtual render()yage::Batchvirtual
    - - + diff --git a/classyage_1_1Batch.html b/classyage_1_1Batch.html index aa72bcbf..e0d45f71 100644 --- a/classyage_1_1Batch.html +++ b/classyage_1_1Batch.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -233,15 +217,11 @@ Public Member Functions
  • yage/render/batch.h
  • -
    - + diff --git a/classyage_1_1Batch.js b/classyage_1_1Batch.js deleted file mode 100644 index 7b07b8e1..00000000 --- a/classyage_1_1Batch.js +++ /dev/null @@ -1,7 +0,0 @@ -var classyage_1_1Batch = -[ - [ "begin", "classyage_1_1Batch.html#ab458f3129d2a329806dd00c6be77709d", null ], - [ "end", "classyage_1_1Batch.html#a322b0fe531c9cfa506d6d2dd786a236e", null ], - [ "init", "classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477", null ], - [ "render", "classyage_1_1Batch.html#a3439c8dd88d87be4460161d233044c65", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Body-members.html b/classyage_1_1Body-members.html index 3d874d0d..31986f0f 100644 --- a/classyage_1_1Body-members.html +++ b/classyage_1_1Body-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Body Member List
    @@ -126,14 +110,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Body.html','');}); xPosition() const yage::Body yPosition() const yage::Body
    - - + diff --git a/classyage_1_1Body.html b/classyage_1_1Body.html index 4f38b9c3..bec54f34 100644 --- a/classyage_1_1Body.html +++ b/classyage_1_1Body.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -441,15 +425,11 @@ Protected Attributes
  • yage/physics/body.cpp
  • -
    - + diff --git a/classyage_1_1Body.js b/classyage_1_1Body.js deleted file mode 100644 index 96fc0f3a..00000000 --- a/classyage_1_1Body.js +++ /dev/null @@ -1,15 +0,0 @@ -var classyage_1_1Body = -[ - [ "Body", "classyage_1_1Body.html#aeca769807d9b6f6fb3c9f61deaa83b86", null ], - [ "applyForce", "classyage_1_1Body.html#a56310be4f9d7d2d4e7f954af0e0a5878", null ], - [ "update", "classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36", null ], - [ "xPosition", "classyage_1_1Body.html#a8a800cef0fb3561332d4a97c790e7225", null ], - [ "yPosition", "classyage_1_1Body.html#a1023ebd31914571f137fb5aadc88c364", null ], - [ "acceleration_", "classyage_1_1Body.html#a36c0a4485bf9a704901d88c6cf212a5f", null ], - [ "force_", "classyage_1_1Body.html#a262c896b473d7672cde524145cd7981d", null ], - [ "GRAVITY", "classyage_1_1Body.html#a4f61913cf00244a6160e09cda846f766", null ], - [ "gravity_", "classyage_1_1Body.html#a454a7c59d07c94afb0a35c3d53ec2191", null ], - [ "mass_", "classyage_1_1Body.html#a01b2a500e71bc88f2cb597f376bc8289", null ], - [ "position_", "classyage_1_1Body.html#a8fe4f244be47f1336a57c1f2aa095157", null ], - [ "velocity_", "classyage_1_1Body.html#afead7edec899748eab78879e6e6c5741", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Body.png b/classyage_1_1Body.png index 4343e414..be1a7140 100644 Binary files a/classyage_1_1Body.png and b/classyage_1_1Body.png differ diff --git a/classyage_1_1Camera-members.html b/classyage_1_1Camera-members.html index 924c374d..b5f6f123 100644 --- a/classyage_1_1Camera-members.html +++ b/classyage_1_1Camera-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Camera Member List
    @@ -118,14 +102,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Camera.html','');}); update(Shader &program)yage::Camera zoom(float factor)yage::Camera
    - - + diff --git a/classyage_1_1Camera.html b/classyage_1_1Camera.html index 4cad68d6..6e792630 100644 --- a/classyage_1_1Camera.html +++ b/classyage_1_1Camera.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -215,7 +199,7 @@ Public Member Functions -
    Todo:
    Make this function more general to be able to be able to use any parametre in then shader as the camera matrix and not make it dependent on it being P.
    +
    Todo:
    Make this function more general to be able to be able to use any parametre in then shader as the camera matrix and not make it dependent on it being P.
    @@ -248,15 +232,11 @@ Public Member Functions
  • yage/core/camera.cpp
  • - - + diff --git a/classyage_1_1Camera.js b/classyage_1_1Camera.js deleted file mode 100644 index fc42c3c3..00000000 --- a/classyage_1_1Camera.js +++ /dev/null @@ -1,7 +0,0 @@ -var classyage_1_1Camera = -[ - [ "Camera", "classyage_1_1Camera.html#a13be1e50638977d62cff9ffba1213611", null ], - [ "move", "classyage_1_1Camera.html#a012820185cceb451926bc4ef1607b324", null ], - [ "update", "classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c", null ], - [ "zoom", "classyage_1_1Camera.html#a8b50af04dae6eca905c5008ef93b72d0", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Collider-members.html b/classyage_1_1Collider-members.html index 95f011a3..81c30bee 100644 --- a/classyage_1_1Collider-members.html +++ b/classyage_1_1Collider-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Collider Member List
    @@ -119,14 +103,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Collider.html','');}); position_yage::Colliderprotected size_yage::Colliderprotected
    - - + diff --git a/classyage_1_1Collider.html b/classyage_1_1Collider.html index ea285f4f..b156d7e4 100644 --- a/classyage_1_1Collider.html +++ b/classyage_1_1Collider.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -275,15 +259,11 @@ Protected Attributes
  • yage/physics/collider.h
  • -
    - + diff --git a/classyage_1_1Collider.js b/classyage_1_1Collider.js deleted file mode 100644 index 0935b310..00000000 --- a/classyage_1_1Collider.js +++ /dev/null @@ -1,8 +0,0 @@ -var classyage_1_1Collider = -[ - [ "Collider", "classyage_1_1Collider.html#ae33aeb0711409e7c3ef9e21ed99fa8a3", null ], - [ "collides", "classyage_1_1Collider.html#abbab9373c0805ffa5215c08b82eaed03", null ], - [ "inside", "classyage_1_1Collider.html#a4a8ad9e664a0015e023a70d196302fe9", null ], - [ "position_", "classyage_1_1Collider.html#a2ae348a82a0ca7a871c05f36e5031161", null ], - [ "size_", "classyage_1_1Collider.html#ad7456f84c1acb4fd9ee0ea67c8ee7308", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Collider.png b/classyage_1_1Collider.png index f00858b9..cccf8d20 100644 Binary files a/classyage_1_1Collider.png and b/classyage_1_1Collider.png differ diff --git a/classyage_1_1CollisionBody-members.html b/classyage_1_1CollisionBody-members.html index 8e7ed13d..589f7d53 100644 --- a/classyage_1_1CollisionBody-members.html +++ b/classyage_1_1CollisionBody-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::CollisionBody Member List
    @@ -128,14 +112,11 @@ $(document).ready(function(){initNavTree('classyage_1_1CollisionBody.html','');} yPosition() const yage::Body ~CollisionBody()yage::CollisionBodyvirtual
    - - + diff --git a/classyage_1_1CollisionBody.html b/classyage_1_1CollisionBody.html index 59bc1aeb..abaf9190 100644 --- a/classyage_1_1CollisionBody.html +++ b/classyage_1_1CollisionBody.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -206,15 +190,11 @@ Additional Inherited Members
  • yage/physics/collisionbody.h
  • -
    - + diff --git a/classyage_1_1CollisionBody.js b/classyage_1_1CollisionBody.js deleted file mode 100644 index ceb8e524..00000000 --- a/classyage_1_1CollisionBody.js +++ /dev/null @@ -1,5 +0,0 @@ -var classyage_1_1CollisionBody = -[ - [ "CollisionBody", "classyage_1_1CollisionBody.html#a5289e613269facc45cd451872c17a83d", null ], - [ "~CollisionBody", "classyage_1_1CollisionBody.html#a758b2f867f276f4c7e02ebda2cd04c8b", null ] -]; \ No newline at end of file diff --git a/classyage_1_1CollisionBody.png b/classyage_1_1CollisionBody.png index c297c566..8a316b80 100644 Binary files a/classyage_1_1CollisionBody.png and b/classyage_1_1CollisionBody.png differ diff --git a/classyage_1_1Drawable-members.html b/classyage_1_1Drawable-members.html index 0e9a29a3..81aa27f5 100644 --- a/classyage_1_1Drawable-members.html +++ b/classyage_1_1Drawable-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Drawable Member List
    @@ -115,14 +99,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Drawable.html','');});
    draw(SpriteBatch &sp)=0yage::Drawablepure virtual
    - - + diff --git a/classyage_1_1Drawable.html b/classyage_1_1Drawable.html index 2dcc7a1a..f46671b2 100644 --- a/classyage_1_1Drawable.html +++ b/classyage_1_1Drawable.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -160,15 +144,11 @@ Public Member Functions
  • yage/render/drawable.h
  • -
    - + diff --git a/classyage_1_1Drawable.js b/classyage_1_1Drawable.js deleted file mode 100644 index 9b0202f2..00000000 --- a/classyage_1_1Drawable.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1Drawable = -[ - [ "draw", "classyage_1_1Drawable.html#abee95e68b5bffef86a35dafca296c45e", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Drawable.png b/classyage_1_1Drawable.png index b2d21aae..fc3dac7a 100644 Binary files a/classyage_1_1Drawable.png and b/classyage_1_1Drawable.png differ diff --git a/classyage_1_1Engine-members.html b/classyage_1_1Engine-members.html new file mode 100644 index 00000000..e25c26aa --- /dev/null +++ b/classyage_1_1Engine-members.html @@ -0,0 +1,113 @@ + + + + + + +YAGE: Member List + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    yage::Engine Member List
    +
    +
    + +

    This is the complete list of members for yage::Engine, including all inherited members.

    + + + + + + +
    addSystem(System *system)yage::Engine
    init()yage::Engine
    instance()yage::Enginestatic
    mainLoop()yage::Engine
    update()yage::Engine
    + + + + diff --git a/classyage_1_1Engine.html b/classyage_1_1Engine.html new file mode 100644 index 00000000..ebed2ace --- /dev/null +++ b/classyage_1_1Engine.html @@ -0,0 +1,237 @@ + + + + + + +YAGE: yage::Engine Class Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Public Member Functions | +Static Public Member Functions | +List of all members
    +
    +
    yage::Engine Class Reference
    +
    +
    + +

    Main engine class that contains a systems, the main loop and the update function that updates all the systems. + More...

    + +

    #include <engine.h>

    + + + + + + + + + + + + + + +

    +Public Member Functions

    void init ()
     Initialize window and other aspects of the engine. More...
     
    void mainLoop ()
     Main game loop of the engine. More...
     
    void update ()
     Updates the systems. More...
     
    void addSystem (System *system)
     Adds a system to the engine. More...
     
    + + + + +

    +Static Public Member Functions

    static Engineinstance ()
     Returns the instance of the engine, as there is only one instance of the engine. More...
     
    +

    Detailed Description

    +

    Main engine class that contains a systems, the main loop and the update function that updates all the systems.

    +

    Member Function Documentation

    + +
    +
    + + + + + + + + +
    void yage::Engine::addSystem (Systemsystem)
    +
    + +

    Adds a system to the engine.

    + +
    +
    + +
    +
    + + + + + + + +
    void yage::Engine::init ()
    +
    + +

    Initialize window and other aspects of the engine.

    + +
    +
    + +
    +
    + + + + + +
    + + + + + + + +
    Engine & yage::Engine::instance ()
    +
    +static
    +
    + +

    Returns the instance of the engine, as there is only one instance of the engine.

    + +
    +
    + +
    +
    + + + + + + + +
    void yage::Engine::mainLoop ()
    +
    + +

    Main game loop of the engine.

    + +
    +
    + +
    +
    + + + + + + + +
    void yage::Engine::update ()
    +
    + +

    Updates the systems.

    + +
    +
    +
    The documentation for this class was generated from the following files: +
    + + + + diff --git a/classyage_1_1Entity-members.html b/classyage_1_1Entity-members.html new file mode 100644 index 00000000..6b3dd7ec --- /dev/null +++ b/classyage_1_1Entity-members.html @@ -0,0 +1,110 @@ + + + + + + +YAGE: Member List + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    yage::Entity Member List
    +
    +
    + +

    This is the complete list of members for yage::Entity, including all inherited members.

    + + + +
    Entity(unsigned handle)yage::Entity
    getHandle() const yage::Entity
    + + + + diff --git a/classyage_1_1Entity.html b/classyage_1_1Entity.html new file mode 100644 index 00000000..d8bdb0d1 --- /dev/null +++ b/classyage_1_1Entity.html @@ -0,0 +1,170 @@ + + + + + + +YAGE: yage::Entity Class Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Public Member Functions | +List of all members
    +
    +
    yage::Entity Class Reference
    +
    +
    + +

    Entity convenience class. + More...

    + +

    #include <entity.h>

    + + + + + + + + +

    +Public Member Functions

     Entity (unsigned handle)
     Creates an instance of an Entity with a handle that is associated to it. More...
     
    unsigned getHandle () const
     Handle getter, as the user will only interact with the id itself. More...
     
    +

    Detailed Description

    +

    Entity convenience class.

    +

    It contains handles to where the entity is in the entity manager of the space, and a pointer back to the space itself.

    +

    This class cannot be instantiated outside of a Space and should only be instantiated through an entity manager, as otherwise the handle will not have a meaning.

    +

    Constructor & Destructor Documentation

    + +
    +
    + + + + + + + + +
    yage::Entity::Entity (unsigned handle)
    +
    + +

    Creates an instance of an Entity with a handle that is associated to it.

    +

    This handle refers to the position of he Entity in the list that is held by the EntityManager, and therefore the id is enough to refer to it.

    + +
    +
    +

    Member Function Documentation

    + +
    +
    + + + + + + + +
    unsigned yage::Entity::getHandle () const
    +
    + +

    Handle getter, as the user will only interact with the id itself.

    +

    The handle is the unique identifier that the user can use to refer to the entity.

    + +
    +
    +
    The documentation for this class was generated from the following files: +
    + + + + diff --git a/classyage_1_1EntityManager-members.html b/classyage_1_1EntityManager-members.html new file mode 100644 index 00000000..94607f49 --- /dev/null +++ b/classyage_1_1EntityManager-members.html @@ -0,0 +1,113 @@ + + + + + + +YAGE: Member List + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    yage::EntityManager Member List
    +
    +
    + +

    This is the complete list of members for yage::EntityManager, including all inherited members.

    + + + + + + +
    createEntity()yage::EntityManager
    createEntityInstance()yage::EntityManager
    EntityManager()=defaultyage::EntityManager
    EntityManager(Space *space)yage::EntityManager
    EntityManager(Space *space, std::size_t n)yage::EntityManager
    + + + + diff --git a/classyage_1_1EntityManager.html b/classyage_1_1EntityManager.html new file mode 100644 index 00000000..fb4b9662 --- /dev/null +++ b/classyage_1_1EntityManager.html @@ -0,0 +1,260 @@ + + + + + + +YAGE: yage::EntityManager Class Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Public Member Functions | +List of all members
    +
    +
    yage::EntityManager Class Reference
    +
    +
    + +

    Manages entities in a space. + More...

    + +

    #include <entitymanager.h>

    + + + + + + + + + + + + + + + + + +

    +Public Member Functions

     EntityManager ()=default
     Default instance of an EntityManager. More...
     
     EntityManager (Space *space)
     Creates an instance of the entity manager, which refers back to the space it was created in and belongs to. More...
     
     EntityManager (Space *space, std::size_t n)
     Creates an instance of the entitiy manager with an initial size. More...
     
    unsigned createEntity ()
     Creates an Entity and returns the handle to the entity, which can then be used by the user to do operations on it. More...
     
    Entity createEntityInstance ()
     Creates an Entity and returns it. More...
     
    +

    Detailed Description

    +

    Manages entities in a space.

    +

    Constructor & Destructor Documentation

    + +
    +
    + + + + + +
    + + + + + + + +
    yage::EntityManager::EntityManager ()
    +
    +default
    +
    + +

    Default instance of an EntityManager.

    + +
    +
    + +
    +
    + + + + + + + + +
    yage::EntityManager::EntityManager (Spacespace)
    +
    + +

    Creates an instance of the entity manager, which refers back to the space it was created in and belongs to.

    +
    Parameters
    + + +
    spaceCurrent space that the EntityManager belongs to.
    +
    +
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + +
    yage::EntityManager::EntityManager (Spacespace,
    std::size_t n 
    )
    +
    + +

    Creates an instance of the entitiy manager with an initial size.

    +
    Parameters
    + + + +
    spaceCurrent space that the EntityManager belongs to.
    nInitial size of the EntityManager.
    +
    +
    + +
    +
    +

    Member Function Documentation

    + +
    +
    + + + + + + + +
    unsigned yage::EntityManager::createEntity ()
    +
    + +

    Creates an Entity and returns the handle to the entity, which can then be used by the user to do operations on it.

    +
    Returns
    The handle to the entity that was created in the space.
    + +
    +
    + +
    +
    + + + + + + + +
    Entity yage::EntityManager::createEntityInstance ()
    +
    + +

    Creates an Entity and returns it.

    +
    Returns
    The entity that was created by the entity manager in the current space.
    + +
    +
    +
    The documentation for this class was generated from the following files: +
    + + + + diff --git a/classyage_1_1ImageLoader-members.html b/classyage_1_1ImageLoader-members.html index 9bbaf089..e0f79933 100644 --- a/classyage_1_1ImageLoader-members.html +++ b/classyage_1_1ImageLoader-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::ImageLoader Member List
    @@ -115,14 +99,11 @@ $(document).ready(function(){initNavTree('classyage_1_1ImageLoader.html','');});
    loadPng(const std::string &file_path)yage::ImageLoaderstatic
    - - + diff --git a/classyage_1_1ImageLoader.html b/classyage_1_1ImageLoader.html index 5c3e36f7..a4510a99 100644 --- a/classyage_1_1ImageLoader.html +++ b/classyage_1_1ImageLoader.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Static Public Member Functions | @@ -151,15 +135,11 @@ Static Public Member Functions
  • yage/core/imageloader.cpp
  • -
    - + diff --git a/classyage_1_1ImageLoader.js b/classyage_1_1ImageLoader.js deleted file mode 100644 index 566d4441..00000000 --- a/classyage_1_1ImageLoader.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1ImageLoader = -[ - [ "loadPng", "classyage_1_1ImageLoader.html#ad8dcdaaed43713f07723f2b6719d1b32", null ] -]; \ No newline at end of file diff --git a/classyage_1_1IoManager-members.html b/classyage_1_1IoManager-members.html index 0c610950..0465e80e 100644 --- a/classyage_1_1IoManager-members.html +++ b/classyage_1_1IoManager-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::IoManager Member List
    @@ -115,14 +99,11 @@ $(document).ready(function(){initNavTree('classyage_1_1IoManager.html','');});
    readFileToBuffer(const std::string &file_path, std::vector< unsigned char > &buffer)yage::IoManagerstatic
    - - + diff --git a/classyage_1_1IoManager.html b/classyage_1_1IoManager.html index 566012bd..963a167e 100644 --- a/classyage_1_1IoManager.html +++ b/classyage_1_1IoManager.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Static Public Member Functions | @@ -161,15 +145,11 @@ Static Public Member Functions
  • yage/core/iomanager.cpp
  • -
    - + diff --git a/classyage_1_1IoManager.js b/classyage_1_1IoManager.js deleted file mode 100644 index c858e019..00000000 --- a/classyage_1_1IoManager.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1IoManager = -[ - [ "readFileToBuffer", "classyage_1_1IoManager.html#a75d13ca634df592e44e4152fedcd446d", null ] -]; \ No newline at end of file diff --git a/classyage_1_1LogMessage-members.html b/classyage_1_1LogMessage-members.html index 170b6b56..1c3e78eb 100644 --- a/classyage_1_1LogMessage-members.html +++ b/classyage_1_1LogMessage-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::LogMessage Member List
    @@ -121,14 +105,11 @@ $(document).ready(function(){initNavTree('classyage_1_1LogMessage.html','');}); operator=(LogMessage &&msg)=deleteyage::LogMessage ~LogMessage()yage::LogMessage
    - - + diff --git a/classyage_1_1LogMessage.html b/classyage_1_1LogMessage.html index 10d1dddb..fd64dc54 100644 --- a/classyage_1_1LogMessage.html +++ b/classyage_1_1LogMessage.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -293,15 +277,11 @@ template<typename T >
  • yage/core/logmessage.cpp
  • - - + diff --git a/classyage_1_1LogMessage.js b/classyage_1_1LogMessage.js deleted file mode 100644 index 5c1ddeaf..00000000 --- a/classyage_1_1LogMessage.js +++ /dev/null @@ -1,11 +0,0 @@ -var classyage_1_1LogMessage = -[ - [ "Meta", "structyage_1_1LogMessage_1_1Meta.html", "structyage_1_1LogMessage_1_1Meta" ], - [ "~LogMessage", "classyage_1_1LogMessage.html#af82ed7ceef5cfdac54ad2e176deb9fca", null ], - [ "LogMessage", "classyage_1_1LogMessage.html#af4ab2630201ecd155c329fbfebe352be", null ], - [ "operator<<", "classyage_1_1LogMessage.html#af79ecd529e839a5a3e99077dde60df90", null ], - [ "operator<<", "classyage_1_1LogMessage.html#a855e0e72055f785def530feaf27cbeab", null ], - [ "operator=", "classyage_1_1LogMessage.html#a31eb7ca394acbcfedca104e709f1c4ae", null ], - [ "operator=", "classyage_1_1LogMessage.html#aed38ed794cdc0b3d7776f424570e92da", null ], - [ "Logger", "classyage_1_1LogMessage.html#aff02b76416d2846736b7ecd798921a0a", null ] -]; \ No newline at end of file diff --git a/classyage_1_1LogSink-members.html b/classyage_1_1LogSink-members.html index c20f7d6c..eb9e89ac 100644 --- a/classyage_1_1LogSink-members.html +++ b/classyage_1_1LogSink-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::LogSink Member List
    @@ -121,14 +105,11 @@ $(document).ready(function(){initNavTree('classyage_1_1LogSink.html','');}); operator==(const LogSink &sink)yage::LogSink write(const LogMessage::Meta &meta, const std::string &msg) const yage::LogSink
    - - + diff --git a/classyage_1_1LogSink.html b/classyage_1_1LogSink.html index e7049c4b..870227fd 100644 --- a/classyage_1_1LogSink.html +++ b/classyage_1_1LogSink.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -266,15 +250,11 @@ template<typename T >
  • yage/core/logsink.cpp
  • - - + diff --git a/classyage_1_1LogSink.js b/classyage_1_1LogSink.js deleted file mode 100644 index f954cc67..00000000 --- a/classyage_1_1LogSink.js +++ /dev/null @@ -1,10 +0,0 @@ -var classyage_1_1LogSink = -[ - [ "LogSink", "classyage_1_1LogSink.html#ab7b70959364771b105c0dffa0b64c38e", null ], - [ "LogSink", "classyage_1_1LogSink.html#a8583ac57ebff98ab38c613c03b5bfbba", null ], - [ "LogSink", "classyage_1_1LogSink.html#aadebaf552b839879189965faf7b504cf", null ], - [ "operator=", "classyage_1_1LogSink.html#a1ba5b4000f07f581e0d0c2babb2811dc", null ], - [ "operator=", "classyage_1_1LogSink.html#a43a7bf025e46197b541f186e16209356", null ], - [ "operator==", "classyage_1_1LogSink.html#abe2e73398ecb925233b50be5d15e20f9", null ], - [ "write", "classyage_1_1LogSink.html#ac41716cf03dac6311cb7287c9edf8a8d", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Logger-members.html b/classyage_1_1Logger-members.html index 296b5aaa..77b11dc1 100644 --- a/classyage_1_1Logger-members.html +++ b/classyage_1_1Logger-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Logger Member List
    @@ -125,14 +109,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Logger.html','');}); remove(const LogSink &sink)yage::Logger setLevel(LogLevel min_level)yage::Logger
    - - + diff --git a/classyage_1_1Logger.html b/classyage_1_1Logger.html index 2ce4a45b..5640877c 100644 --- a/classyage_1_1Logger.html +++ b/classyage_1_1Logger.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -115,10 +99,6 @@ $(document).ready(function(){initNavTree('classyage_1_1Logger.html','');});
    -

    Logger

    - - More...

    -

    #include <logger.h>

    @@ -149,19 +129,7 @@ Static Public Member Functions

    static Loggerinstance ()
     
    -

    Detailed Description

    -

    Logger

    -

    Aynchronous logging is built into the YAGE library, which can be used to log events in the game and also debug the game by using the debug output that the game engine produces. This can help if for example, a texture is being loaded.

    -

    Log levels

    -

    The logger has five different levels that can be assigned to a message. These are, from lowest to highest severity, LogLevel::DEBUG, LogLevel::INFO, LogLevel::WARNING, LogLevel::ERROR and LogLevel::FATAL. Messages that the developer then wants to write to the logs can take any of these severities and the developer can then decide what the minimum severity is that the logger should log. By default, the logger will log anything that is above LogLevel::INFO.

    -

    Using the Logger in your Game

    -

    There are a few preprocessor definitions to make the use of the logger as simple as possible. First of all, there is a definition to get the instance of the current global logger, which can then be used to set a different minimum display level. This definition is yLogger, and an example of how to use it to change the default output level can be seen below

    -

    ``` c++ yLogger.setLevel(yage::LogLevel::ERROR); ```

    -

    The above code changes the global logger so that it will only output things that are an error or fatal and make the engine crash.

    -

    Other preprocessor definitions are yLogDebug, yLogInfo, yLogWarning, yLogError and yLogFatal. These return an object that is similar to a buffer, but belongs to the main global logger yLogger. These are the definitions that should be used to print somehting to the main logger. For example

    -

    ``` c++ yLogWarning << "This is a warning"; ```

    -

    will print the message "This is a warning" with the severity of LogLevel::WARNING.

    -

    Constructor & Destructor Documentation

    +

    Constructor & Destructor Documentation

    @@ -391,15 +359,11 @@ Static Public Member Functions
  • yage/core/logger.cpp
  • -
    - + diff --git a/classyage_1_1Logger.js b/classyage_1_1Logger.js deleted file mode 100644 index f673a3a9..00000000 --- a/classyage_1_1Logger.js +++ /dev/null @@ -1,14 +0,0 @@ -var classyage_1_1Logger = -[ - [ "Logger", "classyage_1_1Logger.html#a950c0c75b86bf330cf11a0ad29bd9a64", null ], - [ "Logger", "classyage_1_1Logger.html#a3d54590303257e9a8d1da26d59571352", null ], - [ "Logger", "classyage_1_1Logger.html#a71f6ab0fa1e86d790553c0763a255b2b", null ], - [ "Logger", "classyage_1_1Logger.html#acbd21a2da8b423e9f606c386cabac074", null ], - [ "add", "classyage_1_1Logger.html#a5ec9a752e8cbb278342fdb49520fbcdd", null ], - [ "clear", "classyage_1_1Logger.html#a036fcbfcb9d3428931ec5a11237501a8", null ], - [ "flush", "classyage_1_1Logger.html#afe5dc1d30d3fd2599a119455672d6e00", null ], - [ "instance", "classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e", null ], - [ "operator()", "classyage_1_1Logger.html#a3c7d6d1a9ccf0397dc81350cef6782f2", null ], - [ "remove", "classyage_1_1Logger.html#aac48688c66402e9bc63c4871641ab245", null ], - [ "setLevel", "classyage_1_1Logger.html#a2ce5eb7eb1b108e38c1b90655999a8eb", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Matrix-members.html b/classyage_1_1Matrix-members.html index 5c732921..a29d8ae6 100644 --- a/classyage_1_1Matrix-members.html +++ b/classyage_1_1Matrix-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Matrix< Rows, Cols, Type > Member List
    @@ -129,14 +113,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Matrix.html','');}); rowSize() const yage::Matrix< Rows, Cols, Type >inline toString() const yage::Matrix< Rows, Cols, Type >inlinevirtual
    -
    - + diff --git a/classyage_1_1Matrix.html b/classyage_1_1Matrix.html index b3384b84..d9b540f1 100644 --- a/classyage_1_1Matrix.html +++ b/classyage_1_1Matrix.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -174,15 +158,6 @@ Friends class yage::Matrix< Rows, Cols, Type >

    Base Matrix class used by other similar classes.

    -

    Matrix Class

    -

    The matrix class is a templated class which implements a mathematical Matrix.

    -

    Usage Guide

    -

    The class can be instantiated

    -

    Example Code

    -

    Creating a Matrix and performing operations on it.

    -

    ``` #include <YAGE/Math/matrix.hpp>

    -

    int main(int, char **) { yage::Matrix<2, 2, int> mat1 {{1, 2, 3, 4}}; yage::Matrix<2, 2, int> mat2 {{5, 6, 7, 8}};

    -

    int dot = yage::math::dot(mat1, mat2); return 0; } ```

    Constructor & Destructor Documentation

    @@ -604,15 +579,11 @@ template<int Rows, int Cols, class Type>
  • yage/math/matrix.h
  • -
    - + diff --git a/classyage_1_1Matrix.js b/classyage_1_1Matrix.js deleted file mode 100644 index 0aa0acd1..00000000 --- a/classyage_1_1Matrix.js +++ /dev/null @@ -1,18 +0,0 @@ -var classyage_1_1Matrix = -[ - [ "Matrix", "classyage_1_1Matrix.html#a73b7d1f94f4f72a2294b71b3a35794ad", null ], - [ "Matrix", "classyage_1_1Matrix.html#a191b02ff353d04f18779d4c84e20927b", null ], - [ "begin", "classyage_1_1Matrix.html#a83d77d3a40ced5e2b703a6d66b6e6055", null ], - [ "colSize", "classyage_1_1Matrix.html#a2148cd52008892765ad90250c68afba1", null ], - [ "end", "classyage_1_1Matrix.html#a20ea5fe16d27ef15f775b5497cadc851", null ], - [ "getCol", "classyage_1_1Matrix.html#a74475218328d6ef69701a6e261df925b", null ], - [ "getRow", "classyage_1_1Matrix.html#a960273d1ac46a8edb71ceee08ee639b8", null ], - [ "operator+=", "classyage_1_1Matrix.html#a8b7e0913efdb5e8c9ff39df4c4f36228", null ], - [ "operator-=", "classyage_1_1Matrix.html#acc2d0763f060c923ce53b37143d0a7bb", null ], - [ "operator[]", "classyage_1_1Matrix.html#a89e826d2c6646002cfae23dde7f61145", null ], - [ "operator[]", "classyage_1_1Matrix.html#a0e989030df9ebc7e3885a7bc811a45c6", null ], - [ "rowSize", "classyage_1_1Matrix.html#a0cc8e242b2e8319789aae0e1d81834a1", null ], - [ "toString", "classyage_1_1Matrix.html#a07678d7007e89487c7168df84f2a4fa8", null ], - [ "details::Row< Rows, Cols, Type >", "classyage_1_1Matrix.html#a9e9cbf0fd7c768696ef909bdac1a706d", null ], - [ "data_", "classyage_1_1Matrix.html#a0ab11922319366f6e74f6e9e7d7abeed", null ] -]; \ No newline at end of file diff --git a/classyage_1_1ParticleBody-members.html b/classyage_1_1ParticleBody-members.html index e3c39658..822ce30a 100644 --- a/classyage_1_1ParticleBody-members.html +++ b/classyage_1_1ParticleBody-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::ParticleBody Member List
    @@ -127,14 +111,11 @@ $(document).ready(function(){initNavTree('classyage_1_1ParticleBody.html','');}) xPosition() const yage::Body yPosition() const yage::Body
    - - + diff --git a/classyage_1_1ParticleBody.html b/classyage_1_1ParticleBody.html index fbf3770b..edc9a51c 100644 --- a/classyage_1_1ParticleBody.html +++ b/classyage_1_1ParticleBody.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -258,15 +242,11 @@ Additional Inherited Members
  • yage/physics/particlebody.cpp
  • -
    - + diff --git a/classyage_1_1ParticleBody.js b/classyage_1_1ParticleBody.js deleted file mode 100644 index 6e5a762b..00000000 --- a/classyage_1_1ParticleBody.js +++ /dev/null @@ -1,6 +0,0 @@ -var classyage_1_1ParticleBody = -[ - [ "ParticleBody", "classyage_1_1ParticleBody.html#ae20aad802b5620597d0521663061efc0", null ], - [ "applyForce", "classyage_1_1ParticleBody.html#a4d6c52fc2106ebd3f131d2be1fa3f11b", null ], - [ "update", "classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c", null ] -]; \ No newline at end of file diff --git a/classyage_1_1ParticleBody.png b/classyage_1_1ParticleBody.png index 1df7c42f..80040da3 100644 Binary files a/classyage_1_1ParticleBody.png and b/classyage_1_1ParticleBody.png differ diff --git a/classyage_1_1Rectangle-members.html b/classyage_1_1Rectangle-members.html index 77fdb16d..b52f7b2b 100644 --- a/classyage_1_1Rectangle-members.html +++ b/classyage_1_1Rectangle-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Rectangle Member List
    @@ -117,14 +101,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Rectangle.html','');}); Rectangle(glm::vec4 position)yage::Rectangle render() const yage::Rectanglevirtual
    - - + diff --git a/classyage_1_1Rectangle.html b/classyage_1_1Rectangle.html index 5321928f..1625e1d6 100644 --- a/classyage_1_1Rectangle.html +++ b/classyage_1_1Rectangle.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -184,15 +168,11 @@ Public Member Functions
  • yage/render/rectangle.cpp
  • -
    - + diff --git a/classyage_1_1Rectangle.js b/classyage_1_1Rectangle.js deleted file mode 100644 index 2781d91b..00000000 --- a/classyage_1_1Rectangle.js +++ /dev/null @@ -1,5 +0,0 @@ -var classyage_1_1Rectangle = -[ - [ "Rectangle", "classyage_1_1Rectangle.html#a45a3203b887ffcdb6a0bc7f5a4de717e", null ], - [ "render", "classyage_1_1Rectangle.html#af9ff615160254c8289e502fac8124891", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Rectangle.png b/classyage_1_1Rectangle.png index 66e49a59..c6ba4f2d 100644 Binary files a/classyage_1_1Rectangle.png and b/classyage_1_1Rectangle.png differ diff --git a/classyage_1_1RectangleCollider-members.html b/classyage_1_1RectangleCollider-members.html index e5943e32..e3efc0ec 100644 --- a/classyage_1_1RectangleCollider-members.html +++ b/classyage_1_1RectangleCollider-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::RectangleCollider Member List
    @@ -120,14 +104,11 @@ $(document).ready(function(){initNavTree('classyage_1_1RectangleCollider.html',' RectangleCollider(const glm::vec2 &position, const glm::vec2 &size)yage::RectangleCollider size_yage::Colliderprotected
    - - + diff --git a/classyage_1_1RectangleCollider.html b/classyage_1_1RectangleCollider.html index ddea7523..6e099b1c 100644 --- a/classyage_1_1RectangleCollider.html +++ b/classyage_1_1RectangleCollider.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -230,15 +214,11 @@ Additional Inherited Members
  • yage/physics/rectanglecollider.cpp
  • -
    - + diff --git a/classyage_1_1RectangleCollider.js b/classyage_1_1RectangleCollider.js deleted file mode 100644 index e61e60ba..00000000 --- a/classyage_1_1RectangleCollider.js +++ /dev/null @@ -1,6 +0,0 @@ -var classyage_1_1RectangleCollider = -[ - [ "RectangleCollider", "classyage_1_1RectangleCollider.html#af9e0964655073b0a190c9d06b449a969", null ], - [ "collides", "classyage_1_1RectangleCollider.html#a81e825cf009a437bc0f61b846cac66f6", null ], - [ "inside", "classyage_1_1RectangleCollider.html#ac8d8e6bdb12c21be12f7d398242147c4", null ] -]; \ No newline at end of file diff --git a/classyage_1_1RectangleCollider.png b/classyage_1_1RectangleCollider.png index d6857b7c..3bcc769a 100644 Binary files a/classyage_1_1RectangleCollider.png and b/classyage_1_1RectangleCollider.png differ diff --git a/classyage_1_1ResourceManager-members.html b/classyage_1_1ResourceManager-members.html index d7ea7127..049164d0 100644 --- a/classyage_1_1ResourceManager-members.html +++ b/classyage_1_1ResourceManager-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::ResourceManager Member List
    @@ -115,14 +99,11 @@ $(document).ready(function(){initNavTree('classyage_1_1ResourceManager.html','')
    getTexture(const std::string &texture_path, int x=1, int y=1)yage::ResourceManagerstatic
    - - + diff --git a/classyage_1_1ResourceManager.html b/classyage_1_1ResourceManager.html index 192aada6..201c50c7 100644 --- a/classyage_1_1ResourceManager.html +++ b/classyage_1_1ResourceManager.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Static Public Member Functions | @@ -167,15 +151,11 @@ Static Public Member Functions
  • yage/core/resourcemanager.cpp
  • -
    - + diff --git a/classyage_1_1ResourceManager.js b/classyage_1_1ResourceManager.js deleted file mode 100644 index 434fd832..00000000 --- a/classyage_1_1ResourceManager.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1ResourceManager = -[ - [ "getTexture", "classyage_1_1ResourceManager.html#aec533f266d9b432050faed301f4191dc", null ] -]; \ No newline at end of file diff --git a/classyage_1_1RigidBody-members.html b/classyage_1_1RigidBody-members.html index 65ed0bc2..4f99eba8 100644 --- a/classyage_1_1RigidBody-members.html +++ b/classyage_1_1RigidBody-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::RigidBody Member List
    @@ -128,14 +112,11 @@ $(document).ready(function(){initNavTree('classyage_1_1RigidBody.html','');}); xPosition() const yage::Body yPosition() const yage::Body
    - - + diff --git a/classyage_1_1RigidBody.html b/classyage_1_1RigidBody.html index 216b1579..5f6ba753 100644 --- a/classyage_1_1RigidBody.html +++ b/classyage_1_1RigidBody.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -209,15 +193,11 @@ Additional Inherited Members
  • yage/physics/rigidbody.cpp
  • -
    - + diff --git a/classyage_1_1RigidBody.js b/classyage_1_1RigidBody.js deleted file mode 100644 index 1cc8d95c..00000000 --- a/classyage_1_1RigidBody.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1RigidBody = -[ - [ "RigidBody", "classyage_1_1RigidBody.html#aed946934f970694c6f6840b09600a606", null ] -]; \ No newline at end of file diff --git a/classyage_1_1RigidBody.png b/classyage_1_1RigidBody.png index bfa1f2e1..c6fa27ca 100644 Binary files a/classyage_1_1RigidBody.png and b/classyage_1_1RigidBody.png differ diff --git a/classyage_1_1Shader-members.html b/classyage_1_1Shader-members.html index b8e56be4..a7f384f8 100644 --- a/classyage_1_1Shader-members.html +++ b/classyage_1_1Shader-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Shader Member List
    @@ -124,14 +108,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Shader.html','');}); use() const yage::Shader ~Shader()yage::Shader
    - - + diff --git a/classyage_1_1Shader.html b/classyage_1_1Shader.html index 68534505..1bc1e7e3 100644 --- a/classyage_1_1Shader.html +++ b/classyage_1_1Shader.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -383,15 +367,11 @@ Public Member Functions
  • yage/render/shader.cpp
  • -
    - + diff --git a/classyage_1_1Shader.js b/classyage_1_1Shader.js deleted file mode 100644 index e622dd76..00000000 --- a/classyage_1_1Shader.js +++ /dev/null @@ -1,13 +0,0 @@ -var classyage_1_1Shader = -[ - [ "Shader", "classyage_1_1Shader.html#a34fe30eb6e6d595c1996e8ea6fb3961a", null ], - [ "Shader", "classyage_1_1Shader.html#a1a006dcb52a4fb9f1dc61df68d3676f5", null ], - [ "Shader", "classyage_1_1Shader.html#adf6dc3a526921d62b55a552f38958dd2", null ], - [ "~Shader", "classyage_1_1Shader.html#a9307c4f3cfaf5e584b70601294e09bdd", null ], - [ "operator=", "classyage_1_1Shader.html#a5d966c327ae0749ca5758880b684103a", null ], - [ "operator=", "classyage_1_1Shader.html#af94e7c75abb18015ade6126465a5fe05", null ], - [ "setUniform", "classyage_1_1Shader.html#ac9bff8500e2adfa1745c843bc612f215", null ], - [ "setUniform", "classyage_1_1Shader.html#a1a637a37d3e72fe1cd53602e80ab23ab", null ], - [ "setUniform", "classyage_1_1Shader.html#a96c50a15f45d064f43d1f01e84105e78", null ], - [ "use", "classyage_1_1Shader.html#a8cd66c177f148ac0b619766188696e6c", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Shape-members.html b/classyage_1_1Shape-members.html index bcedd5eb..a0044086 100644 --- a/classyage_1_1Shape-members.html +++ b/classyage_1_1Shape-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Shape Member List
    @@ -116,14 +100,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Shape.html','');}); draw(SpriteBatch &sp)=0yage::Drawablepure virtual render() const yage::Shapevirtual
    - - + diff --git a/classyage_1_1Shape.html b/classyage_1_1Shape.html index e05ad146..9267a988 100644 --- a/classyage_1_1Shape.html +++ b/classyage_1_1Shape.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -164,15 +148,11 @@ Public Member Functions
  • yage/render/shape.h
  • -
    - + diff --git a/classyage_1_1Shape.js b/classyage_1_1Shape.js deleted file mode 100644 index 184d37cc..00000000 --- a/classyage_1_1Shape.js +++ /dev/null @@ -1,4 +0,0 @@ -var classyage_1_1Shape = -[ - [ "render", "classyage_1_1Shape.html#ab83fd121fe04debf98b42f29c919b539", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Shape.png b/classyage_1_1Shape.png index 03bbb1c3..7e5208f4 100644 Binary files a/classyage_1_1Shape.png and b/classyage_1_1Shape.png differ diff --git a/classyage_1_1Space-members.html b/classyage_1_1Space-members.html new file mode 100644 index 00000000..a89e81e2 --- /dev/null +++ b/classyage_1_1Space-members.html @@ -0,0 +1,110 @@ + + + + + + +YAGE: Member List + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    yage::Space Member List
    +
    +
    + +

    This is the complete list of members for yage::Space, including all inherited members.

    + + + +
    createEntity()yage::Space
    Space()yage::Space
    + + + + diff --git a/classyage_1_1Space.html b/classyage_1_1Space.html new file mode 100644 index 00000000..b3a7bf6b --- /dev/null +++ b/classyage_1_1Space.html @@ -0,0 +1,167 @@ + + + + + + +YAGE: yage::Space Class Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Public Member Functions | +List of all members
    +
    +
    yage::Space Class Reference
    +
    +
    + +

    Space that keeps track of all the entities, componenets and runs the systems on the data to update them. + More...

    + +

    #include <space.h>

    + + + + + + + + +

    +Public Member Functions

     Space ()
     Default instance for a space. More...
     
    unsigned createEntity ()
     Create an entity that will belong to this space, and return the handle to the user. More...
     
    +

    Detailed Description

    +

    Space that keeps track of all the entities, componenets and runs the systems on the data to update them.

    +

    There can be multiple instances of a space, which can be used, for example, for different levels in the game that can be loaded separately, or a game menu that can be loaded above the other spaces when the user presses on pause.

    +

    Constructor & Destructor Documentation

    + +
    +
    + + + + + + + +
    yage::Space::Space ()
    +
    + +

    Default instance for a space.

    + +
    +
    +

    Member Function Documentation

    + +
    +
    + + + + + + + +
    unsigned yage::Space::createEntity ()
    +
    + +

    Create an entity that will belong to this space, and return the handle to the user.

    +

    The Entity class itself should not be visible to the user, as the user only needs to worry about the handle when referring to the Entity and changing it.

    + +
    +
    +
    The documentation for this class was generated from the following files: +
    + + + + diff --git a/classyage_1_1Sprite-members.html b/classyage_1_1Sprite-members.html index 196bb106..2a1d0560 100644 --- a/classyage_1_1Sprite-members.html +++ b/classyage_1_1Sprite-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Sprite Member List
    @@ -122,14 +106,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Sprite.html','');}); Sprite(Sprite &&)=deleteyage::Sprite ~Sprite()yage::Sprite
    - - + diff --git a/classyage_1_1Sprite.html b/classyage_1_1Sprite.html index c7dad307..b35fa938 100644 --- a/classyage_1_1Sprite.html +++ b/classyage_1_1Sprite.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -337,15 +321,11 @@ Public Member Functions
  • yage/render/sprite.cpp
  • -
    - + diff --git a/classyage_1_1Sprite.js b/classyage_1_1Sprite.js deleted file mode 100644 index e259dffa..00000000 --- a/classyage_1_1Sprite.js +++ /dev/null @@ -1,11 +0,0 @@ -var classyage_1_1Sprite = -[ - [ "Sprite", "classyage_1_1Sprite.html#a113bfddfa62846a1d8391d1b86de7987", null ], - [ "Sprite", "classyage_1_1Sprite.html#aa5a7958e17f1d042226b91fb1829642e", null ], - [ "Sprite", "classyage_1_1Sprite.html#a33789b3e37bfcb84ed89ec69f47817a1", null ], - [ "~Sprite", "classyage_1_1Sprite.html#aa2f833e040940616fa17ee8f02f8cab2", null ], - [ "draw", "classyage_1_1Sprite.html#a8eed26f4fa57b3ad47d791564233ee40", null ], - [ "init", "classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1", null ], - [ "operator=", "classyage_1_1Sprite.html#a97dd80e05efb9399ee8471ff40a77bee", null ], - [ "operator=", "classyage_1_1Sprite.html#a3fe5615022d2b157b9e6375197254897", null ] -]; \ No newline at end of file diff --git a/classyage_1_1SpriteBatch-members.html b/classyage_1_1SpriteBatch-members.html index 611cf116..08cb5dd5 100644 --- a/classyage_1_1SpriteBatch-members.html +++ b/classyage_1_1SpriteBatch-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::SpriteBatch Member List
    @@ -125,14 +109,11 @@ $(document).ready(function(){initNavTree('classyage_1_1SpriteBatch.html','');}); SpriteBatch(SpriteBatch &&)=deleteyage::SpriteBatch ~SpriteBatch()yage::SpriteBatch
    - - + diff --git a/classyage_1_1SpriteBatch.html b/classyage_1_1SpriteBatch.html index df6340d2..7502f869 100644 --- a/classyage_1_1SpriteBatch.html +++ b/classyage_1_1SpriteBatch.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -388,15 +372,11 @@ Static Public Attributes
  • yage/render/spritebatch.cpp
  • -
    - + diff --git a/classyage_1_1SpriteBatch.js b/classyage_1_1SpriteBatch.js deleted file mode 100644 index c35d41df..00000000 --- a/classyage_1_1SpriteBatch.js +++ /dev/null @@ -1,14 +0,0 @@ -var classyage_1_1SpriteBatch = -[ - [ "SpriteBatch", "classyage_1_1SpriteBatch.html#afda50a8a2a6c9ffd1b9d962fae223f8a", null ], - [ "SpriteBatch", "classyage_1_1SpriteBatch.html#a30a46a7182235a739916d540781af652", null ], - [ "SpriteBatch", "classyage_1_1SpriteBatch.html#a7f18a506f4188acd2219da8147dc0e1e", null ], - [ "~SpriteBatch", "classyage_1_1SpriteBatch.html#afa26d86730be23aa5e0c8c4a9d67001a", null ], - [ "begin", "classyage_1_1SpriteBatch.html#af6293aac69e1124199297e5b921a4872", null ], - [ "draw", "classyage_1_1SpriteBatch.html#acf88f98ccc7ce8effd2acfded27b6af0", null ], - [ "end", "classyage_1_1SpriteBatch.html#af8b705cdad7ceefa902f3be620ac8632", null ], - [ "operator=", "classyage_1_1SpriteBatch.html#a1b365d89c096d7fa138e1c7091f1d737", null ], - [ "operator=", "classyage_1_1SpriteBatch.html#a204782dd15c82376555ad0b049c4167f", null ], - [ "render", "classyage_1_1SpriteBatch.html#a195c4aca60815d413c65dce99389282d", null ], - [ "NUM_VERTICES", "classyage_1_1SpriteBatch.html#a6e01d11880a841b153e950aa8307b1a5", null ] -]; \ No newline at end of file diff --git a/classyage_1_1SpriteSheet-members.html b/classyage_1_1SpriteSheet-members.html index 0720ce24..d8ffb399 100644 --- a/classyage_1_1SpriteSheet-members.html +++ b/classyage_1_1SpriteSheet-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::SpriteSheet Member List
    @@ -117,14 +101,11 @@ $(document).ready(function(){initNavTree('classyage_1_1SpriteSheet.html','');}); sprite(std::string spriteName) const yage::SpriteSheet SpriteSheet(std::string pngFileName, std::string jsonFileName)yage::SpriteSheet
    - - + diff --git a/classyage_1_1SpriteSheet.html b/classyage_1_1SpriteSheet.html index ec7fe4bd..06792c1d 100644 --- a/classyage_1_1SpriteSheet.html +++ b/classyage_1_1SpriteSheet.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -190,15 +174,11 @@ Public Member Functions
  • yage/core/spritesheet.cpp
  • -
    - + diff --git a/classyage_1_1SpriteSheet.js b/classyage_1_1SpriteSheet.js deleted file mode 100644 index b1cf4ac0..00000000 --- a/classyage_1_1SpriteSheet.js +++ /dev/null @@ -1,6 +0,0 @@ -var classyage_1_1SpriteSheet = -[ - [ "SpriteSheet", "classyage_1_1SpriteSheet.html#a73db999ab17c4846f036eb47470176f6", null ], - [ "fileContent", "classyage_1_1SpriteSheet.html#a50a04ebc989dbc63b0aa6d873da5ccd9", null ], - [ "sprite", "classyage_1_1SpriteSheet.html#a2734c2e7b8bdfc9090d240c070ee55c0", null ] -]; \ No newline at end of file diff --git a/classyage_1_1SyncQueue-members.html b/classyage_1_1SyncQueue-members.html index a91b6da7..43586d68 100644 --- a/classyage_1_1SyncQueue-members.html +++ b/classyage_1_1SyncQueue-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::SyncQueue< T > Member List
    @@ -121,14 +105,11 @@ $(document).ready(function(){initNavTree('classyage_1_1SyncQueue.html','');}); SyncQueue()=defaultyage::SyncQueue< T > SyncQueue(const SyncQueue &)=deleteyage::SyncQueue< T >
    - - + diff --git a/classyage_1_1SyncQueue.html b/classyage_1_1SyncQueue.html index d4fd5fb5..69932dc1 100644 --- a/classyage_1_1SyncQueue.html +++ b/classyage_1_1SyncQueue.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -287,15 +271,11 @@ template<typename T>
  • yage/util/syncqueue.h
  • - - + diff --git a/classyage_1_1SyncQueue.js b/classyage_1_1SyncQueue.js deleted file mode 100644 index e616f0c7..00000000 --- a/classyage_1_1SyncQueue.js +++ /dev/null @@ -1,10 +0,0 @@ -var classyage_1_1SyncQueue = -[ - [ "SyncQueue", "classyage_1_1SyncQueue.html#a0c8aa1c22e3e6d5094dbdeb88cff426b", null ], - [ "SyncQueue", "classyage_1_1SyncQueue.html#a8f42b9b34c6495680aade2563cc2359c", null ], - [ "operator=", "classyage_1_1SyncQueue.html#a43e4ba65c8e367ed55da9b8e3e1567b6", null ], - [ "pop", "classyage_1_1SyncQueue.html#a1f7f099e1347b82c1f2b72a5352ca05e", null ], - [ "pop", "classyage_1_1SyncQueue.html#ab8a3c646e1d2f9adfcbcfbaa2e2a4b27", null ], - [ "push", "classyage_1_1SyncQueue.html#a4ef8940b49b9c1b7a213fd38847370b1", null ], - [ "push", "classyage_1_1SyncQueue.html#a4c01a855e97a46449a97c76634ef7678", null ] -]; \ No newline at end of file diff --git a/classyage_1_1System-members.html b/classyage_1_1System-members.html new file mode 100644 index 00000000..624e76a5 --- /dev/null +++ b/classyage_1_1System-members.html @@ -0,0 +1,111 @@ + + + + + + +YAGE: Member List + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    yage::System Member List
    +
    +
    + +

    This is the complete list of members for yage::System, including all inherited members.

    + + + + +
    init()=0yage::Systempure virtual
    update(double dt)=0yage::Systempure virtual
    ~System()=0yage::Systeminlinepure virtual
    + + + + diff --git a/classyage_1_1System.html b/classyage_1_1System.html new file mode 100644 index 00000000..801e2ee8 --- /dev/null +++ b/classyage_1_1System.html @@ -0,0 +1,218 @@ + + + + + + +YAGE: yage::System Class Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Public Member Functions | +List of all members
    +
    +
    yage::System Class Referenceabstract
    +
    +
    + +

    System interface for the different systems in the engine. + More...

    + +

    #include <system.h>

    + + + + + + + + + + + +

    +Public Member Functions

    virtual ~System ()=0
     Virtual destructor to destroy all the objects that implement this properly. More...
     
    virtual void init ()=0
     Initializes the system. More...
     
    virtual void update (double dt)=0
     Updates the system at each interval using the time step. More...
     
    +

    Detailed Description

    +

    System interface for the different systems in the engine.

    +

    Constructor & Destructor Documentation

    + +
    +
    + + + + + +
    + + + + + + + +
    yage::System::~System ()
    +
    +inlinepure virtual
    +
    + +

    Virtual destructor to destroy all the objects that implement this properly.

    +

    Implement the default destructor, but leaving it as purely virtual in the definition of the abstract class.

    +

    This is so that the classes that implement the abstract class have to implement a desctructor, but at the same time, that there is no undefined behavious when the stack unwinds to the system and calls the system destructor.

    + +
    +
    +

    Member Function Documentation

    + +
    +
    + + + + + +
    + + + + + + + +
    virtual void yage::System::init ()
    +
    +pure virtual
    +
    + +

    Initializes the system.

    +

    Good practice to have this function instead using the constructor.

    + +
    +
    + +
    +
    + + + + + +
    + + + + + + + + +
    virtual void yage::System::update (double dt)
    +
    +pure virtual
    +
    + +

    Updates the system at each interval using the time step.

    +
    Parameters
    + + +
    dtThe time difference between the previous frame and the current one.
    +
    +
    + +
    +
    +
    The documentation for this class was generated from the following file: +
    + + + + diff --git a/classyage_1_1TextureCache-members.html b/classyage_1_1TextureCache-members.html index aded535a..ccef794e 100644 --- a/classyage_1_1TextureCache-members.html +++ b/classyage_1_1TextureCache-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::TextureCache Member List
    @@ -117,14 +101,11 @@ $(document).ready(function(){initNavTree('classyage_1_1TextureCache.html','');}) getTextureFromSpriteSheet()yage::TextureCache TextureCache()=defaultyage::TextureCache
    - - + diff --git a/classyage_1_1TextureCache.html b/classyage_1_1TextureCache.html index 3f5c5bfe..a820a2cd 100644 --- a/classyage_1_1TextureCache.html +++ b/classyage_1_1TextureCache.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -202,15 +186,11 @@ Public Member Functions
  • yage/core/texturecache.cpp
  • -
    - + diff --git a/classyage_1_1TextureCache.js b/classyage_1_1TextureCache.js deleted file mode 100644 index 633a3443..00000000 --- a/classyage_1_1TextureCache.js +++ /dev/null @@ -1,6 +0,0 @@ -var classyage_1_1TextureCache = -[ - [ "TextureCache", "classyage_1_1TextureCache.html#a5f6af0bd513dd393061b2d9d18362692", null ], - [ "getTexture", "classyage_1_1TextureCache.html#ad4929640230f9a74fcd634416fe0974f", null ], - [ "getTextureFromSpriteSheet", "classyage_1_1TextureCache.html#abb785ce35eb847c02de67dc9e6e06bcd", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Vector-members.html b/classyage_1_1Vector-members.html index 4427a43b..3a6fa299 100644 --- a/classyage_1_1Vector-members.html +++ b/classyage_1_1Vector-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Vector< Rows, Type > Member List
    @@ -131,14 +115,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Vector.html','');}); Vector(const Matrix< Rows, 1, Type > &other)yage::Vector< Rows, Type >inline Vector(const std::vector< Type > &data)yage::Vector< Rows, Type >inline
    - - + diff --git a/classyage_1_1Vector.html b/classyage_1_1Vector.html index c26d6b34..cbdd5709 100644 --- a/classyage_1_1Vector.html +++ b/classyage_1_1Vector.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -345,15 +329,11 @@ template<int Rows = 2, class Type = double>
  • yage/math/matrix.h
  • - - + diff --git a/classyage_1_1Vector.js b/classyage_1_1Vector.js deleted file mode 100644 index 0b54d8f3..00000000 --- a/classyage_1_1Vector.js +++ /dev/null @@ -1,9 +0,0 @@ -var classyage_1_1Vector = -[ - [ "Vector", "classyage_1_1Vector.html#ac9b202913c03bde201e350e855fbbffa", null ], - [ "Vector", "classyage_1_1Vector.html#a55fd6c60a95832ad4b68083071f9866f", null ], - [ "Vector", "classyage_1_1Vector.html#aa291a8ee264f81165b529b7f3a0c265d", null ], - [ "operator[]", "classyage_1_1Vector.html#a81efa1cb9d4ce8bb8c5cf9652a5650a2", null ], - [ "operator[]", "classyage_1_1Vector.html#a54c22538916cfb3b838724b8f8662c35", null ], - [ "toString", "classyage_1_1Vector.html#a956f7b6d02c0309adece311f59c8beae", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Vector.png b/classyage_1_1Vector.png index ec1fc517..84e68746 100644 Binary files a/classyage_1_1Vector.png and b/classyage_1_1Vector.png differ diff --git a/classyage_1_1Vector2-members.html b/classyage_1_1Vector2-members.html index d52d63a8..91b3931b 100644 --- a/classyage_1_1Vector2-members.html +++ b/classyage_1_1Vector2-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Vector2< Type > Member List
    @@ -139,14 +123,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Vector2.html','');}); y()yage::Vector2< Type >inline y() const yage::Vector2< Type >inline
    - - + diff --git a/classyage_1_1Vector2.html b/classyage_1_1Vector2.html index 9a4c65ea..265ffadc 100644 --- a/classyage_1_1Vector2.html +++ b/classyage_1_1Vector2.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -426,15 +410,11 @@ template<typename Type = double>
  • yage/math/matrix.h
  • - - + diff --git a/classyage_1_1Vector2.js b/classyage_1_1Vector2.js deleted file mode 100644 index a5b0a087..00000000 --- a/classyage_1_1Vector2.js +++ /dev/null @@ -1,11 +0,0 @@ -var classyage_1_1Vector2 = -[ - [ "Vector2", "classyage_1_1Vector2.html#a50c108903be424de1c41ce31fddd23ea", null ], - [ "Vector2", "classyage_1_1Vector2.html#af69d534302a406bac419589e0a2f2917", null ], - [ "Vector2", "classyage_1_1Vector2.html#a3ef3bc2954f387f1db2165a884765ad0", null ], - [ "Vector2", "classyage_1_1Vector2.html#aacee766d18741a925a47b91fa0080822", null ], - [ "x", "classyage_1_1Vector2.html#a5a777413b63e68dc5f797d31e3d7beaf", null ], - [ "x", "classyage_1_1Vector2.html#a14a436185842f7375d02b57a37832740", null ], - [ "y", "classyage_1_1Vector2.html#a554645b415a76af47698985b7757f0c2", null ], - [ "y", "classyage_1_1Vector2.html#a216ac57d39572b46ab8307a7728e4456", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Vector2.png b/classyage_1_1Vector2.png index 20f24356..1419db17 100644 Binary files a/classyage_1_1Vector2.png and b/classyage_1_1Vector2.png differ diff --git a/classyage_1_1Vector3-members.html b/classyage_1_1Vector3-members.html index be7d9594..84db5c76 100644 --- a/classyage_1_1Vector3-members.html +++ b/classyage_1_1Vector3-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Vector3< Type > Member List
    @@ -140,14 +124,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Vector3.html','');}); zyage::Vector3< Type > z(this->data_[2])yage::Vector3< Type >inline
    - - + diff --git a/classyage_1_1Vector3.html b/classyage_1_1Vector3.html index 260a5cd7..639450d5 100644 --- a/classyage_1_1Vector3.html +++ b/classyage_1_1Vector3.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -417,15 +401,11 @@ template<typename Type = double>
  • yage/math/matrix.h
  • - - + diff --git a/classyage_1_1Vector3.js b/classyage_1_1Vector3.js deleted file mode 100644 index e7bc875b..00000000 --- a/classyage_1_1Vector3.js +++ /dev/null @@ -1,12 +0,0 @@ -var classyage_1_1Vector3 = -[ - [ "Vector3", "classyage_1_1Vector3.html#a745b76ba3e49f5c73f53cb065ddf337b", null ], - [ "Vector3", "classyage_1_1Vector3.html#ad30c9989f25ef241c59a6c59661daf3a", null ], - [ "Vector3", "classyage_1_1Vector3.html#a36744e7ef6c50b117e4105f1752c93c0", null ], - [ "x", "classyage_1_1Vector3.html#ae91b009b2e5e81163ebf80bf5bcbe7f0", null ], - [ "y", "classyage_1_1Vector3.html#a9b984c33ac0a7d7ade6963baea0e5ee8", null ], - [ "z", "classyage_1_1Vector3.html#ad8efd76556fe2ff568f81ce1d4dd1888", null ], - [ "x", "classyage_1_1Vector3.html#aca2fa665275db5e0b842f64106b0c797", null ], - [ "y", "classyage_1_1Vector3.html#a3076edb39227c1fcc77a8160fb9c5832", null ], - [ "z", "classyage_1_1Vector3.html#a163c42efd0a4f365abb612c031859820", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Vector3.png b/classyage_1_1Vector3.png index 85404b15..5106c770 100644 Binary files a/classyage_1_1Vector3.png and b/classyage_1_1Vector3.png differ diff --git a/classyage_1_1Vector4-members.html b/classyage_1_1Vector4-members.html index e659d92f..15553b8f 100644 --- a/classyage_1_1Vector4-members.html +++ b/classyage_1_1Vector4-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Vector4< Type > Member List
    @@ -142,14 +126,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Vector4.html','');}); zyage::Vector4< Type > z(this->data_[2])yage::Vector4< Type >
    - - + diff --git a/classyage_1_1Vector4.html b/classyage_1_1Vector4.html index 6aad2def..c423aa05 100644 --- a/classyage_1_1Vector4.html +++ b/classyage_1_1Vector4.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -458,15 +442,11 @@ template<typename Type = double>
  • yage/math/matrix.h
  • - - + diff --git a/classyage_1_1Vector4.js b/classyage_1_1Vector4.js deleted file mode 100644 index 0bf3d6ac..00000000 --- a/classyage_1_1Vector4.js +++ /dev/null @@ -1,14 +0,0 @@ -var classyage_1_1Vector4 = -[ - [ "Vector4", "classyage_1_1Vector4.html#ab6e8f6e88c13d3bbfa1a6591d97b7d03", null ], - [ "Vector4", "classyage_1_1Vector4.html#ae40311bf406263427426a7de5108c6c1", null ], - [ "Vector4", "classyage_1_1Vector4.html#a36537a95ca1764334fe9b9b1f001206d", null ], - [ "w", "classyage_1_1Vector4.html#a111ecbf09543e8fafaf3aedef77d168d", null ], - [ "x", "classyage_1_1Vector4.html#ad6d84a870f51573b60490591cdbd8b4c", null ], - [ "y", "classyage_1_1Vector4.html#a0c7bf86ba48c9bda10e0605441bb8c3c", null ], - [ "z", "classyage_1_1Vector4.html#aad3540315f15d69a84aa4573d3e1c583", null ], - [ "w", "classyage_1_1Vector4.html#acf752077d460438407ed3c84fe199f63", null ], - [ "x", "classyage_1_1Vector4.html#a4936ef80cc2726f6b20f525977339a13", null ], - [ "y", "classyage_1_1Vector4.html#ae0609f2db5e14fe05fddd71ec09f4735", null ], - [ "z", "classyage_1_1Vector4.html#ac1b2968c7a6a6e9f2c74507760b73cdc", null ] -]; \ No newline at end of file diff --git a/classyage_1_1Vector4.png b/classyage_1_1Vector4.png index 52c18fa1..493b0c76 100644 Binary files a/classyage_1_1Vector4.png and b/classyage_1_1Vector4.png differ diff --git a/classyage_1_1Window-members.html b/classyage_1_1Window-members.html index 680a0334..ef2be8bf 100644 --- a/classyage_1_1Window-members.html +++ b/classyage_1_1Window-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Window Member List
    @@ -128,14 +112,11 @@ $(document).ready(function(){initNavTree('classyage_1_1Window.html','');}); Window(Window &&)=deleteyage::Window ~Window()yage::Window
    - - + diff --git a/classyage_1_1Window.html b/classyage_1_1Window.html index 1674efe5..d3654abe 100644 --- a/classyage_1_1Window.html +++ b/classyage_1_1Window.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -444,15 +428,11 @@ Public Member Functions
  • yage/core/window.cpp
  • -
    - + diff --git a/classyage_1_1Window.js b/classyage_1_1Window.js deleted file mode 100644 index a4df96c8..00000000 --- a/classyage_1_1Window.js +++ /dev/null @@ -1,17 +0,0 @@ -var classyage_1_1Window = -[ - [ "Window", "classyage_1_1Window.html#a7d7bd2f22e095df387e8b5cda2bb484e", null ], - [ "Window", "classyage_1_1Window.html#a1225a2b5eff6d44a6bce3f0f5f10e2bf", null ], - [ "Window", "classyage_1_1Window.html#a4be115daea6c7473fca81623c547d821", null ], - [ "~Window", "classyage_1_1Window.html#a9a8dd109e145c459e52abb3a8861e3a0", null ], - [ "clearBuffer", "classyage_1_1Window.html#a98e2a33820ad63b2c94c56e203ff6e58", null ], - [ "create", "classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745", null ], - [ "hide", "classyage_1_1Window.html#aa421df451f166dfe6441562e92b99115", null ], - [ "keyPressed", "classyage_1_1Window.html#ae95d8670801c04af43da9e4fcc0e1006", null ], - [ "operator=", "classyage_1_1Window.html#a5247a4164bf0006fe9f034cd27c5b6db", null ], - [ "operator=", "classyage_1_1Window.html#a98c07656f90a6205f24dfe85ef1137de", null ], - [ "pollEvents", "classyage_1_1Window.html#a1a311e27b1e588f0fce540ce040dcbd5", null ], - [ "shouldClose", "classyage_1_1Window.html#a5e3b209289bc343609d809d5b7f23cc8", null ], - [ "show", "classyage_1_1Window.html#a0847f40df2aafd7da1c315fa84871f34", null ], - [ "swapBuffer", "classyage_1_1Window.html#a86d0aa8e9896850b9acfc720b5615359", null ] -]; \ No newline at end of file diff --git a/classyage_1_1details_1_1Row-members.html b/classyage_1_1details_1_1Row-members.html index e3ae13c5..20cc6c58 100644 --- a/classyage_1_1details_1_1Row-members.html +++ b/classyage_1_1details_1_1Row-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::details::Row< Rows, Cols, Type > Member List
    @@ -117,14 +101,11 @@ $(document).ready(function(){initNavTree('classyage_1_1details_1_1Row.html',''); operator[](int col) const yage::details::Row< Rows, Cols, Type >inline Row(Matrix< Rows, Cols, Type > *parent, int index)yage::details::Row< Rows, Cols, Type >inline
    - - + diff --git a/classyage_1_1details_1_1Row.html b/classyage_1_1details_1_1Row.html index ec0d3570..89e78dac 100644 --- a/classyage_1_1details_1_1Row.html +++ b/classyage_1_1details_1_1Row.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -219,15 +203,11 @@ template<int Rows, int Cols, class Type >
  • yage/math/matrix.h
  • - - + diff --git a/classyage_1_1details_1_1Row.js b/classyage_1_1details_1_1Row.js deleted file mode 100644 index 35437654..00000000 --- a/classyage_1_1details_1_1Row.js +++ /dev/null @@ -1,6 +0,0 @@ -var classyage_1_1details_1_1Row = -[ - [ "Row", "classyage_1_1details_1_1Row.html#a18904acbce1c6084bc25a753989b5f06", null ], - [ "operator[]", "classyage_1_1details_1_1Row.html#a703d4eee36d93b1227ad734bdcf27190", null ], - [ "operator[]", "classyage_1_1details_1_1Row.html#adf2f7047871fdc78ba66d9d08cd07736", null ] -]; \ No newline at end of file diff --git a/closed.png b/closed.png index 98cc2c90..d4a7003a 100644 Binary files a/closed.png and b/closed.png differ diff --git a/collider_8h.html b/collider_8h.html index 1d7dc290..4a6c79c7 100644 --- a/collider_8h.html +++ b/collider_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -127,7 +111,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -135,15 +119,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/collider_8h_source.html b/collider_8h_source.html index 6ab9310a..b301bc28 100644 --- a/collider_8h_source.html +++ b/collider_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    collider.h
    @@ -151,15 +135,11 @@ $(document).ready(function(){initNavTree('collider_8h_source.html','');});
    glm::vec2 size_
    Definition: collider.h:26
    Definition: collider.h:19
    - - + diff --git a/collisionbody_8h.html b/collisionbody_8h.html index 8e9ed25e..1d3a4c5a 100644 --- a/collisionbody_8h.html +++ b/collisionbody_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -127,7 +111,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -135,15 +119,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/collisionbody_8h_source.html b/collisionbody_8h_source.html index 2564ee63..27ea0b47 100644 --- a/collisionbody_8h_source.html +++ b/collisionbody_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    collisionbody.h
    @@ -135,15 +119,11 @@ $(document).ready(function(){initNavTree('collisionbody_8h_source.html','');});
    virtual ~CollisionBody()
    Definition: collisionbody.h:19
    - - + diff --git a/component_8h.html b/component_8h.html new file mode 100644 index 00000000..d52ddd6f --- /dev/null +++ b/component_8h.html @@ -0,0 +1,156 @@ + + + + + + +YAGE: yage/engine/component.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Classes | +Enumerations
    +
    +
    component.h File Reference
    +
    +
    + +


    + +More...

    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    class  Component
     
    + + + +

    +Enumerations

    enum  ComponentEnum { ComponentEnum::POSITION, +ComponentEnum::NAX_COMPONENTS + }
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +

    Enumeration Type Documentation

    + +
    +
    + + + + + +
    + + + + +
    enum ComponentEnum
    +
    +strong
    +
    + + + +
    Enumerator
    POSITION  +
    NAX_COMPONENTS  +
    + +
    +
    +
    + + + + diff --git a/component_8h_source.html b/component_8h_source.html new file mode 100644 index 00000000..2f90d8a1 --- /dev/null +++ b/component_8h_source.html @@ -0,0 +1,121 @@ + + + + + + +YAGE: yage/engine/component.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    component.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_ENGINE_COMPONENT_H
    +
    10 #define YAGE_ENGINE_COMPONENT_H
    +
    11 
    +
    12 class Component
    +
    13 {
    +
    14 };
    +
    15 
    +
    16 enum class ComponentEnum {
    +
    17  POSITION,
    + +
    19 };
    +
    20 
    +
    21 #endif
    + + +
    ComponentEnum
    Definition: component.h:16
    +
    Definition: component.h:12
    +
    + + + + diff --git a/deprecated.html b/deprecated.html index 3881ecd5..983d3d55 100644 --- a/deprecated.html +++ b/deprecated.html @@ -8,13 +8,6 @@ - - - - -
    +
    Deprecated List
    @@ -107,14 +87,11 @@ $(document).ready(function(){initNavTree('deprecated.html','');});
    Use SpriteBatch instead
    - - + diff --git a/dir_059f34b87ae2c2af887b23a7e5e8e88f.html b/dir_059f34b87ae2c2af887b23a7e5e8e88f.html index c113419e..b9a04c09 100644 --- a/dir_059f34b87ae2c2af887b23a7e5e8e88f.html +++ b/dir_059f34b87ae2c2af887b23a7e5e8e88f.html @@ -8,13 +8,6 @@ - - - - -
    + +
    render Directory Reference
    @@ -106,14 +90,24 @@ $(document).ready(function(){initNavTree('dir_059f34b87ae2c2af887b23a7e5e8e88f.h

    Files

    file  batch.h [code]
    +
      file  drawable.h [code]
    +
      file  ellipse.h [code]
    +
      file  rectangle.cpp
    +
      file  rectangle.h [code]
    +
      file  shader.cpp  
    @@ -124,6 +118,8 @@ Files
      file  shape.h [code]
    +
      file  sprite.cpp  
    @@ -143,15 +139,11 @@ Files  
    - - + diff --git a/dir_059f34b87ae2c2af887b23a7e5e8e88f.js b/dir_059f34b87ae2c2af887b23a7e5e8e88f.js deleted file mode 100644 index 1e784721..00000000 --- a/dir_059f34b87ae2c2af887b23a7e5e8e88f.js +++ /dev/null @@ -1,31 +0,0 @@ -var dir_059f34b87ae2c2af887b23a7e5e8e88f = -[ - [ "batch.h", "batch_8h.html", [ - [ "Batch", "classyage_1_1Batch.html", "classyage_1_1Batch" ] - ] ], - [ "drawable.h", "drawable_8h.html", [ - [ "Drawable", "classyage_1_1Drawable.html", "classyage_1_1Drawable" ] - ] ], - [ "ellipse.h", "ellipse_8h.html", null ], - [ "rectangle.cpp", "rectangle_8cpp.html", null ], - [ "rectangle.h", "rectangle_8h.html", [ - [ "Rectangle", "classyage_1_1Rectangle.html", "classyage_1_1Rectangle" ] - ] ], - [ "shader.cpp", "shader_8cpp.html", null ], - [ "shader.h", "shader_8h.html", [ - [ "Shader", "classyage_1_1Shader.html", "classyage_1_1Shader" ] - ] ], - [ "shape.h", "shape_8h.html", [ - [ "Shape", "classyage_1_1Shape.html", "classyage_1_1Shape" ] - ] ], - [ "sprite.cpp", "sprite_8cpp.html", null ], - [ "sprite.h", "sprite_8h.html", [ - [ "Sprite", "classyage_1_1Sprite.html", "classyage_1_1Sprite" ] - ] ], - [ "spritebatch.cpp", "spritebatch_8cpp.html", null ], - [ "spritebatch.h", "spritebatch_8h.html", [ - [ "RenderBatch", "structyage_1_1details_1_1RenderBatch.html", "structyage_1_1details_1_1RenderBatch" ], - [ "Glyph", "structyage_1_1details_1_1Glyph.html", "structyage_1_1details_1_1Glyph" ], - [ "SpriteBatch", "classyage_1_1SpriteBatch.html", "classyage_1_1SpriteBatch" ] - ] ] -]; \ No newline at end of file diff --git a/dir_0a5be4b85c8e2c05f7a9f5a803f53125.html b/dir_0a5be4b85c8e2c05f7a9f5a803f53125.html index 390ba8f6..ae697851 100644 --- a/dir_0a5be4b85c8e2c05f7a9f5a803f53125.html +++ b/dir_0a5be4b85c8e2c05f7a9f5a803f53125.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage Directory Reference
    @@ -109,6 +93,8 @@ Directories   directory  data   +directory  engine +  directory  math   directory  physics @@ -130,15 +116,11 @@ Files  
    - - + diff --git a/dir_0a5be4b85c8e2c05f7a9f5a803f53125.js b/dir_0a5be4b85c8e2c05f7a9f5a803f53125.js deleted file mode 100644 index e14ab1ef..00000000 --- a/dir_0a5be4b85c8e2c05f7a9f5a803f53125.js +++ /dev/null @@ -1,11 +0,0 @@ -var dir_0a5be4b85c8e2c05f7a9f5a803f53125 = -[ - [ "core", "dir_11841e5da2063fc5766a682aee38e289.html", "dir_11841e5da2063fc5766a682aee38e289" ], - [ "data", "dir_d09e80fdcf0bb585bbe3b7099c52d028.html", "dir_d09e80fdcf0bb585bbe3b7099c52d028" ], - [ "math", "dir_aa7f86daaaa64c448f636c0e65de2cec.html", "dir_aa7f86daaaa64c448f636c0e65de2cec" ], - [ "physics", "dir_a58d7658bbcfd3d3d7296185ebe55c28.html", "dir_a58d7658bbcfd3d3d7296185ebe55c28" ], - [ "render", "dir_059f34b87ae2c2af887b23a7e5e8e88f.html", "dir_059f34b87ae2c2af887b23a7e5e8e88f" ], - [ "util", "dir_48a91ae829881cbedcfc124d2027890d.html", "dir_48a91ae829881cbedcfc124d2027890d" ], - [ "yage.cpp", "yage_8cpp.html", "yage_8cpp" ], - [ "yage.h", "yage_8h.html", "yage_8h" ] -]; \ No newline at end of file diff --git a/dir_11841e5da2063fc5766a682aee38e289.html b/dir_11841e5da2063fc5766a682aee38e289.html index 7207655d..0eeeea38 100644 --- a/dir_11841e5da2063fc5766a682aee38e289.html +++ b/dir_11841e5da2063fc5766a682aee38e289.html @@ -8,13 +8,6 @@ - - - - -
    + +
    core Directory Reference
    @@ -195,15 +179,11 @@ Files  
    - - + diff --git a/dir_11841e5da2063fc5766a682aee38e289.js b/dir_11841e5da2063fc5766a682aee38e289.js deleted file mode 100644 index 2ed33b81..00000000 --- a/dir_11841e5da2063fc5766a682aee38e289.js +++ /dev/null @@ -1,39 +0,0 @@ -var dir_11841e5da2063fc5766a682aee38e289 = -[ - [ "camera.cpp", "camera_8cpp.html", null ], - [ "camera.h", "camera_8h.html", [ - [ "Camera", "classyage_1_1Camera.html", "classyage_1_1Camera" ] - ] ], - [ "imageloader.cpp", "imageloader_8cpp.html", null ], - [ "imageloader.h", "imageloader_8h.html", [ - [ "ImageLoader", "classyage_1_1ImageLoader.html", "classyage_1_1ImageLoader" ] - ] ], - [ "iomanager.cpp", "iomanager_8cpp.html", null ], - [ "iomanager.h", "iomanager_8h.html", [ - [ "IoManager", "classyage_1_1IoManager.html", "classyage_1_1IoManager" ] - ] ], - [ "logger.cpp", "logger_8cpp.html", null ], - [ "logger.h", "logger_8h.html", "logger_8h" ], - [ "loglevel.h", "loglevel_8h.html", "loglevel_8h" ], - [ "logmessage.cpp", "logmessage_8cpp.html", null ], - [ "logmessage.h", "logmessage_8h.html", [ - [ "LogMessage", "classyage_1_1LogMessage.html", "classyage_1_1LogMessage" ], - [ "Meta", "structyage_1_1LogMessage_1_1Meta.html", "structyage_1_1LogMessage_1_1Meta" ] - ] ], - [ "logsink.cpp", "logsink_8cpp.html", "logsink_8cpp" ], - [ "logsink.h", "logsink_8h.html", "logsink_8h" ], - [ "resourcemanager.cpp", "resourcemanager_8cpp.html", null ], - [ "resourcemanager.h", "resourcemanager_8h.html", [ - [ "ResourceManager", "classyage_1_1ResourceManager.html", "classyage_1_1ResourceManager" ] - ] ], - [ "spritesheet.cpp", "spritesheet_8cpp.html", null ], - [ "spritesheet.h", "spritesheet_8h.html", "spritesheet_8h" ], - [ "stb_image.cpp", "stb__image_8cpp.html", "stb__image_8cpp" ], - [ "stb_image.h", "stb__image_8h.html", "stb__image_8h" ], - [ "texturecache.cpp", "texturecache_8cpp.html", null ], - [ "texturecache.h", "texturecache_8h.html", [ - [ "TextureCache", "classyage_1_1TextureCache.html", "classyage_1_1TextureCache" ] - ] ], - [ "window.cpp", "window_8cpp.html", null ], - [ "window.h", "window_8h.html", "window_8h" ] -]; \ No newline at end of file diff --git a/dir_4360c3054e876104aec8d81523b584e2.html b/dir_4360c3054e876104aec8d81523b584e2.html new file mode 100644 index 00000000..90c152ea --- /dev/null +++ b/dir_4360c3054e876104aec8d81523b584e2.html @@ -0,0 +1,141 @@ + + + + + + +YAGE: yage/engine Directory Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    engine Directory Reference
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Files

    file  component.h [code]
     
    +
     
    file  engine.cpp
     
    +
     
    file  engine.h [code]
     
    +
     
    file  entity.cpp
     
    +
     
    file  entity.h [code]
     
    +
     
    file  entitymanager.cpp
     
    +
     
    file  entitymanager.h [code]
     
    +
     
    file  space.cpp
     
    +
     
    file  space.h [code]
     
    +
     
    file  system.h [code]
     
    +
     
    +
    + + + + diff --git a/dir_48a91ae829881cbedcfc124d2027890d.html b/dir_48a91ae829881cbedcfc124d2027890d.html index b4c18c61..88f0de7f 100644 --- a/dir_48a91ae829881cbedcfc124d2027890d.html +++ b/dir_48a91ae829881cbedcfc124d2027890d.html @@ -8,13 +8,6 @@ - - - - -
    + +
    util Directory Reference
    @@ -119,15 +103,11 @@ Files  
    - - + diff --git a/dir_48a91ae829881cbedcfc124d2027890d.js b/dir_48a91ae829881cbedcfc124d2027890d.js deleted file mode 100644 index b8915136..00000000 --- a/dir_48a91ae829881cbedcfc124d2027890d.js +++ /dev/null @@ -1,10 +0,0 @@ -var dir_48a91ae829881cbedcfc124d2027890d = -[ - [ "active.cpp", "active_8cpp.html", null ], - [ "active.h", "active_8h.html", [ - [ "Active", "classyage_1_1Active.html", "classyage_1_1Active" ] - ] ], - [ "syncqueue.h", "syncqueue_8h.html", [ - [ "SyncQueue", "classyage_1_1SyncQueue.html", "classyage_1_1SyncQueue" ] - ] ] -]; \ No newline at end of file diff --git a/dir_a58d7658bbcfd3d3d7296185ebe55c28.html b/dir_a58d7658bbcfd3d3d7296185ebe55c28.html index 51e8c5d6..7d1a9e0c 100644 --- a/dir_a58d7658bbcfd3d3d7296185ebe55c28.html +++ b/dir_a58d7658bbcfd3d3d7296185ebe55c28.html @@ -8,13 +8,6 @@ - - - - -
    + +
    physics Directory Reference
    @@ -151,15 +135,11 @@ Files  
    - - + diff --git a/dir_a58d7658bbcfd3d3d7296185ebe55c28.js b/dir_a58d7658bbcfd3d3d7296185ebe55c28.js deleted file mode 100644 index 134bb3fe..00000000 --- a/dir_a58d7658bbcfd3d3d7296185ebe55c28.js +++ /dev/null @@ -1,26 +0,0 @@ -var dir_a58d7658bbcfd3d3d7296185ebe55c28 = -[ - [ "body.cpp", "body_8cpp.html", null ], - [ "body.h", "body_8h.html", [ - [ "Body", "classyage_1_1Body.html", "classyage_1_1Body" ] - ] ], - [ "collider.h", "collider_8h.html", [ - [ "Collider", "classyage_1_1Collider.html", "classyage_1_1Collider" ] - ] ], - [ "collisionbody.h", "collisionbody_8h.html", [ - [ "CollisionBody", "classyage_1_1CollisionBody.html", "classyage_1_1CollisionBody" ] - ] ], - [ "particlebody.cpp", "particlebody_8cpp.html", null ], - [ "particlebody.h", "particlebody_8h.html", [ - [ "ParticleBody", "classyage_1_1ParticleBody.html", "classyage_1_1ParticleBody" ] - ] ], - [ "physics.h", "physics_8h.html", null ], - [ "rectanglecollider.cpp", "rectanglecollider_8cpp.html", null ], - [ "rectanglecollider.h", "rectanglecollider_8h.html", [ - [ "RectangleCollider", "classyage_1_1RectangleCollider.html", "classyage_1_1RectangleCollider" ] - ] ], - [ "rigidbody.cpp", "rigidbody_8cpp.html", null ], - [ "rigidbody.h", "rigidbody_8h.html", [ - [ "RigidBody", "classyage_1_1RigidBody.html", "classyage_1_1RigidBody" ] - ] ] -]; \ No newline at end of file diff --git a/dir_aa7f86daaaa64c448f636c0e65de2cec.html b/dir_aa7f86daaaa64c448f636c0e65de2cec.html index a5e5d3b9..635d1f31 100644 --- a/dir_aa7f86daaaa64c448f636c0e65de2cec.html +++ b/dir_aa7f86daaaa64c448f636c0e65de2cec.html @@ -8,13 +8,6 @@ - - - - -
    + +
    math Directory Reference
    @@ -111,15 +95,11 @@ Files  
    - - + diff --git a/dir_aa7f86daaaa64c448f636c0e65de2cec.js b/dir_aa7f86daaaa64c448f636c0e65de2cec.js deleted file mode 100644 index fe9f35e4..00000000 --- a/dir_aa7f86daaaa64c448f636c0e65de2cec.js +++ /dev/null @@ -1,4 +0,0 @@ -var dir_aa7f86daaaa64c448f636c0e65de2cec = -[ - [ "matrix.h", "matrix_8h.html", "matrix_8h" ] -]; \ No newline at end of file diff --git a/dir_d09e80fdcf0bb585bbe3b7099c52d028.html b/dir_d09e80fdcf0bb585bbe3b7099c52d028.html index 921a1b65..0270a34c 100644 --- a/dir_d09e80fdcf0bb585bbe3b7099c52d028.html +++ b/dir_d09e80fdcf0bb585bbe3b7099c52d028.html @@ -8,13 +8,6 @@ - - - - -
    + +
    data Directory Reference
    @@ -119,15 +103,11 @@ Files  
    - - + diff --git a/dir_d09e80fdcf0bb585bbe3b7099c52d028.js b/dir_d09e80fdcf0bb585bbe3b7099c52d028.js deleted file mode 100644 index 1cab60df..00000000 --- a/dir_d09e80fdcf0bb585bbe3b7099c52d028.js +++ /dev/null @@ -1,13 +0,0 @@ -var dir_d09e80fdcf0bb585bbe3b7099c52d028 = -[ - [ "input.h", "input_8h.html", "input_8h" ], - [ "texture.h", "texture_8h.html", [ - [ "Texture", "structyage_1_1Texture.html", "structyage_1_1Texture" ] - ] ], - [ "vertex.h", "vertex_8h.html", [ - [ "Position", "structyage_1_1Position.html", "structyage_1_1Position" ], - [ "Colour", "structyage_1_1Colour.html", "structyage_1_1Colour" ], - [ "UV", "structyage_1_1UV.html", "structyage_1_1UV" ], - [ "Vertex", "structyage_1_1Vertex.html", "structyage_1_1Vertex" ] - ] ] -]; \ No newline at end of file diff --git a/doxygen.css b/doxygen.css index f0f36f89..c43273bf 100644 --- a/doxygen.css +++ b/doxygen.css @@ -18,8 +18,8 @@ h1.groupheader { } h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; + border-bottom: 1px solid #EC8766; + color: #9E3513; font-size: 150%; font-weight: normal; margin-top: 1.75em; @@ -93,8 +93,8 @@ h3.version { } div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #FCEBE6; + border: 1px solid #F0A38A; text-align: center; } @@ -110,13 +110,13 @@ div.navtab { /* @group Link Styling */ a { - color: #3D578C; + color: #B33D15; font-weight: normal; text-decoration: none; } .contents a:visited { - color: #4665A2; + color: #D04619; } a:hover { @@ -129,9 +129,9 @@ a.qindex { a.qindexHL { font-weight: bold; - background-color: #9CAFD4; + background-color: #EF9C80; color: #ffffff; - border: 1px double #869DCA; + border: 1px double #EC8664; } .contents a.qindexHL:visited { @@ -175,8 +175,8 @@ pre.fragment { div.fragment { padding: 4px 6px; margin: 4px 8px 4px 2px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; + background-color: #FEFBFA; + border: 1px solid #F6C4B4; } div.line { @@ -269,9 +269,9 @@ div.contents { } td.indexkey { - background-color: #EBEFF6; + background-color: #FCEBE6; font-weight: bold; - border: 1px solid #C4CFE5; + border: 1px solid #F6C4B4; margin: 2px 0px 2px 0; padding: 2px 10px; white-space: nowrap; @@ -279,14 +279,14 @@ td.indexkey { } td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; + background-color: #FCEBE6; + border: 1px solid #F6C4B4; padding: 2px 10px; margin: 2px 0px; } tr.memlist { - background-color: #EEF1F7; + background-color: #FCEEE9; } p.formulaDsp { @@ -369,8 +369,8 @@ span.vhdllogic { } blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; + background-color: #FDF7F4; + border-left: 2px solid #EF9C80; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } @@ -403,18 +403,18 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid #F0A38A; } th.dirtab { - background: #EBEFF6; + background: #FCEBE6; font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid #DA4A1A; } hr.footer { @@ -449,7 +449,7 @@ table.memberdecls { .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: #FEF9F7; border: none; margin: 4px; padding: 1px 0 0 8px; @@ -476,7 +476,7 @@ table.memberdecls { } .memTemplParams { - color: #4665A2; + color: #D04619; white-space: nowrap; font-size: 80%; } @@ -489,14 +489,14 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: #D04619; font-weight: normal; margin-left: 9px; } .memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #FCEBE6; + border: 1px solid #F0A38A; text-align: center; margin: 2px; margin-right: 15px; @@ -534,16 +534,16 @@ table.memberdecls { } .memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid #F1A890; + border-left: 1px solid #F1A890; + border-right: 1px solid #F1A890; padding: 6px 0px 6px 0px; - color: #253555; + color: #6D250D; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); background-image:url('nav_f.png'); background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: #FAE2DA; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; @@ -560,11 +560,11 @@ table.memberdecls { } .memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #F1A890; + border-left: 1px solid #F1A890; + border-right: 1px solid #F1A890; padding: 6px 10px 2px 10px; - background-color: #FBFCFD; + background-color: #FEFBFA; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; @@ -651,11 +651,11 @@ span.mlabels { } span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; + background-color: #E9724B; + border-top:1px solid #E45323; + border-left:1px solid #E45323; + border-right:1px solid #F6C4B4; + border-bottom:1px solid #F6C4B4; text-shadow: none; color: white; margin-right: 4px; @@ -713,7 +713,7 @@ div.directory { .directory tr.even { padding-left: 6px; - background-color: #F7F8FB; + background-color: #FDF7F4; } .directory img { @@ -731,7 +731,7 @@ div.directory { cursor: pointer; padding-left: 2px; padding-right: 2px; - color: #3D578C; + color: #B33D15; } div.dynheader { @@ -746,7 +746,7 @@ div.dynheader { address { font-style: normal; - color: #2A3D61; + color: #7D2A0F; } table.doxtable { @@ -756,12 +756,12 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid #852D10; padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; + background-color: #A33713; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; @@ -771,7 +771,7 @@ table.doxtable th { table.fieldtable { /*width: 100%;*/ margin-bottom: 10px; - border: 1px solid #A8B8D9; + border: 1px solid #F1A890; border-spacing: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -787,8 +787,8 @@ table.fieldtable { .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; + border-right: 1px solid #F1A890; + border-bottom: 1px solid #F1A890; vertical-align: top; } @@ -797,7 +797,7 @@ table.fieldtable { } .fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; + border-bottom: 1px solid #F1A890; /*width: 100%;*/ } @@ -816,9 +816,9 @@ table.fieldtable { .fieldtable th { background-image:url('nav_f.png'); background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: #FAE2DA; font-size: 90%; - color: #253555; + color: #6D250D; padding-bottom: 4px; padding-top: 5px; text-align:left; @@ -828,7 +828,7 @@ table.fieldtable { -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; + border-bottom: 1px solid #F1A890; } @@ -850,8 +850,8 @@ table.fieldtable { background-position: 0 -5px; height:30px; line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; + color:#EC8A69; + border:solid 1px #F5C2B1; overflow:hidden; margin:0px; padding:0px; @@ -866,7 +866,7 @@ table.fieldtable { background-image:url('bc_s.png'); background-repeat:no-repeat; background-position:right; - color:#364D7C; + color:#9F3613; } .navpath li.navelem a @@ -875,7 +875,7 @@ table.fieldtable { display:block; text-decoration: none; outline: none; - color: #283A5D; + color: #77280E; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; @@ -883,7 +883,7 @@ table.fieldtable { .navpath li.navelem a:hover { - color:#6884BD; + color:#E7683E; } .navpath li.footer @@ -895,7 +895,7 @@ table.fieldtable { background-image:none; background-repeat:no-repeat; background-position:right; - color:#364D7C; + color:#9F3613; font-size: 8pt; } @@ -930,9 +930,9 @@ div.header { background-image:url('nav_h.png'); background-repeat:repeat-x; - background-color: #F9FAFC; + background-color: #FEF9F7; margin: 0px; - border-bottom: 1px solid #C4CFE5; + border-bottom: 1px solid #F6C4B4; } div.headertitle @@ -1051,7 +1051,7 @@ dl.section dd { padding: 0px; margin: 0px; width: 100%; - border-bottom: 1px solid #5373B4; + border-bottom: 1px solid #E45323; } .image @@ -1081,7 +1081,7 @@ dl.section dd { div.zoom { - border: 1px solid #90A5CE; + border: 1px solid #ED9071; } dl.citelist { @@ -1089,7 +1089,7 @@ dl.citelist { } dl.citelist dt { - color:#334975; + color:#963312; float:left; font-weight:bold; margin-right:10px; @@ -1103,8 +1103,8 @@ dl.citelist dd { div.toc { padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; + background-color: #FDF4F2; + border: 1px solid #F9D8CD; border-radius: 7px 7px 7px 7px; float: right; height: auto; @@ -1122,7 +1122,7 @@ div.toc li { div.toc h3 { font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; + color: #D04619; border-bottom: 0 none; margin: 0; } diff --git a/doxygen.png b/doxygen.png index 3ff17d80..ca80265c 100644 Binary files a/doxygen.png and b/doxygen.png differ diff --git a/drawable_8h.html b/drawable_8h.html index 3932b7ed..c8e91fc2 100644 --- a/drawable_8h.html +++ b/drawable_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -111,6 +95,10 @@ $(document).ready(function(){initNavTree('drawable_8h.html','');});
    drawable.h File Reference
    + +


    + +More...

    #include "spritebatch.h"

    Go to the source code of this file.

    @@ -123,19 +111,19 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
      -
    - +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    - + diff --git a/drawable_8h_source.html b/drawable_8h_source.html index 1713d10a..8d983519 100644 --- a/drawable_8h_source.html +++ b/drawable_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    drawable.h
    -Go to the documentation of this file.
    1 #ifndef YAGE_CORE_DRAWABLE_H
    -
    2 #define YAGE_CORE_DRAWABLE_H
    -
    3 
    -
    4 #include "spritebatch.h"
    -
    5 
    -
    6 namespace yage
    -
    7 {
    -
    8 
    -
    9 class Drawable
    -
    10 {
    -
    11 public:
    -
    12  virtual void draw(SpriteBatch &sp) = 0;
    -
    13 };
    -
    14 
    -
    15 } // namespace yage
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_CORE_DRAWABLE_H
    +
    10 #define YAGE_CORE_DRAWABLE_H
    +
    11 
    +
    12 #include "spritebatch.h"
    +
    13 
    +
    14 namespace yage
    +
    15 {
    16 
    -
    17 #endif
    +
    17 class Drawable
    +
    18 {
    +
    19 public:
    +
    20  virtual void draw(SpriteBatch &sp) = 0;
    +
    21 };
    +
    22 
    +
    23 } // namespace yage
    +
    24 
    +
    25 #endif
    Definition: spritebatch.h:59
    -
    Definition: drawable.h:9
    +
    Definition: drawable.h:17
    virtual void draw(SpriteBatch &sp)=0
    -
    - + diff --git a/ellipse_8h.html b/ellipse_8h.html index d5522248..ba0e0ecb 100644 --- a/ellipse_8h.html +++ b/ellipse_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    ellipse.h File Reference
    +


    + +More...

    +

    Go to the source code of this file.

    -
    - +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    - + diff --git a/ellipse_8h_source.html b/ellipse_8h_source.html index ae93794d..a55448f4 100644 --- a/ellipse_8h_source.html +++ b/ellipse_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    ellipse.h
    -Go to the documentation of this file.
    1 #ifndef YAGE_RENDER_ELLIPSE_H
    -
    2 #define YAGE_RENDER_ELLIPSE_H
    -
    3 
    -
    4 
    -
    5 
    -
    6 #endif
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_RENDER_ELLIPSE_H
    +
    10 #define YAGE_RENDER_ELLIPSE_H
    +
    11 
    +
    12 #endif
    -
    - + diff --git a/engine_8cpp.html b/engine_8cpp.html new file mode 100644 index 00000000..6eed5e2e --- /dev/null +++ b/engine_8cpp.html @@ -0,0 +1,121 @@ + + + + + + +YAGE: yage/engine/engine.cpp File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Namespaces
    +
    +
    engine.cpp File Reference
    +
    +
    + +


    + +More...

    +
    #include "engine.h"
    +
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/engine_8h.html b/engine_8h.html new file mode 100644 index 00000000..52628b6f --- /dev/null +++ b/engine_8h.html @@ -0,0 +1,132 @@ + + + + + + +YAGE: yage/engine/engine.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Classes | +Namespaces
    +
    +
    engine.h File Reference
    +
    +
    + +


    + +More...

    +
    #include "../core/window.h"
    +#include "system.h"
    +#include <vector>
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  yage::Engine
     Main engine class that contains a systems, the main loop and the update function that updates all the systems. More...
     
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/engine_8h_source.html b/engine_8h_source.html new file mode 100644 index 00000000..95be9bb1 --- /dev/null +++ b/engine_8h_source.html @@ -0,0 +1,146 @@ + + + + + + +YAGE: yage/engine/engine.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    engine.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_CORE_ENGINE_H
    +
    10 #define YAGE_CORE_ENGINE_H
    +
    11 
    +
    12 #include "../core/window.h"
    +
    13 #include "system.h"
    +
    14 
    +
    15 #include <vector>
    +
    16 
    +
    17 namespace yage
    +
    18 {
    +
    19 
    +
    22 class Engine
    +
    23 {
    +
    24 public:
    +
    26  void init();
    +
    27 
    +
    29  void mainLoop();
    +
    30 
    +
    32  void update();
    +
    33 
    +
    35  void addSystem(System *system);
    +
    36 
    +
    39  static Engine &instance();
    +
    40 
    +
    41 private:
    +
    43  std::vector<System *> systems_;
    +
    44 
    +
    46  Window window_;
    +
    47 };
    +
    48 
    +
    49 } // namespace yage
    +
    50 
    +
    51 #endif
    +
    void addSystem(System *system)
    Adds a system to the engine.
    Definition: engine.cpp:43
    +
    static Engine & instance()
    Returns the instance of the engine, as there is only one instance of the engine.
    Definition: engine.cpp:48
    +
    System interface for the different systems in the engine.
    Definition: system.h:18
    +
    Definition: window.h:30
    +
    Main engine class that contains a systems, the main loop and the update function that updates all the...
    Definition: engine.h:22
    +
    void update()
    Updates the systems.
    Definition: engine.cpp:34
    +
    void init()
    Initialize window and other aspects of the engine.
    Definition: engine.cpp:14
    +
    void mainLoop()
    Main game loop of the engine.
    Definition: engine.cpp:23
    + +
    + + + + diff --git a/entity_8cpp.html b/entity_8cpp.html new file mode 100644 index 00000000..6ee833b7 --- /dev/null +++ b/entity_8cpp.html @@ -0,0 +1,122 @@ + + + + + + +YAGE: yage/engine/entity.cpp File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Namespaces
    +
    +
    entity.cpp File Reference
    +
    +
    + +


    + +More...

    +
    #include "entity.h"
    +#include "space.h"
    +
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/entity_8h.html b/entity_8h.html new file mode 100644 index 00000000..2aaab811 --- /dev/null +++ b/entity_8h.html @@ -0,0 +1,130 @@ + + + + + + +YAGE: yage/engine/entity.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Classes | +Namespaces
    +
    +
    entity.h File Reference
    +
    +
    + +


    + +More...

    +
    #include <vector>
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  yage::Entity
     Entity convenience class. More...
     
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/entity_8h_source.html b/entity_8h_source.html new file mode 100644 index 00000000..5d468902 --- /dev/null +++ b/entity_8h_source.html @@ -0,0 +1,131 @@ + + + + + + +YAGE: yage/engine/entity.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    entity.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_ENGINE_ENTITY_H
    +
    10 #define YAGE_ENGINE_ENTITY_H
    +
    11 
    +
    12 #include <vector>
    +
    13 
    +
    14 namespace yage
    +
    15 {
    +
    16 
    +
    17 class Space;
    +
    18 
    +
    27 class Entity
    +
    28 {
    +
    29 public:
    +
    35  Entity(unsigned handle);
    +
    36 
    +
    42  unsigned getHandle() const;
    +
    43 
    +
    44 private:
    +
    48  unsigned handle_;
    +
    49 };
    +
    50 
    +
    51 } // namespace yage
    +
    52 
    +
    53 #endif
    +
    Entity convenience class.
    Definition: entity.h:27
    +
    Entity(unsigned handle)
    Creates an instance of an Entity with a handle that is associated to it.
    Definition: entity.cpp:16
    +
    unsigned getHandle() const
    Handle getter, as the user will only interact with the id itself.
    Definition: entity.cpp:18
    +
    + + + + diff --git a/entitymanager_8cpp.html b/entitymanager_8cpp.html new file mode 100644 index 00000000..8e8af4d6 --- /dev/null +++ b/entitymanager_8cpp.html @@ -0,0 +1,121 @@ + + + + + + +YAGE: yage/engine/entitymanager.cpp File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Namespaces
    +
    +
    entitymanager.cpp File Reference
    +
    +
    + +


    + +More...

    +
    #include "entitymanager.h"
    +
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/entitymanager_8h.html b/entitymanager_8h.html new file mode 100644 index 00000000..f1f691b1 --- /dev/null +++ b/entitymanager_8h.html @@ -0,0 +1,131 @@ + + + + + + +YAGE: yage/engine/entitymanager.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +Classes | +Namespaces
    +
    +
    entitymanager.h File Reference
    +
    +
    + +


    + +More...

    +
    #include "entity.h"
    +#include <vector>
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  yage::EntityManager
     Manages entities in a space. More...
     
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/entitymanager_8h_source.html b/entitymanager_8h_source.html new file mode 100644 index 00000000..6c3cc92f --- /dev/null +++ b/entitymanager_8h_source.html @@ -0,0 +1,147 @@ + + + + + + +YAGE: yage/engine/entitymanager.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + + +
    +
    +
    +
    entitymanager.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_ENGINE_ENTITYMANAGER_H
    +
    10 #define YAGE_ENGINE_ENTITYMANAGER_H
    +
    11 
    +
    12 #include "entity.h"
    +
    13 
    +
    14 #include <vector>
    +
    15 
    +
    16 namespace yage
    +
    17 {
    +
    18 
    +
    19 class Space;
    +
    20 
    + +
    25 {
    +
    26 public:
    +
    30  EntityManager() = default;
    +
    31 
    +
    38  EntityManager(Space *space);
    +
    39 
    +
    46  EntityManager(Space *space, std::size_t n);
    +
    47 
    +
    54  unsigned createEntity();
    +
    55 
    + +
    63 
    +
    64 private:
    +
    68  unsigned next_handle_;
    +
    69 
    +
    73  Space *space_;
    +
    74 
    +
    78  std::vector<Entity> entities_;
    +
    79 };
    +
    80 
    +
    81 } // namespace yage
    +
    82 
    +
    83 #endif
    + +
    unsigned createEntity()
    Creates an Entity and returns the handle to the entity, which can then be used by the user to do oper...
    Definition: entitymanager.cpp:22
    +
    Manages entities in a space.
    Definition: entitymanager.h:24
    +
    Entity createEntityInstance()
    Creates an Entity and returns it.
    Definition: entitymanager.cpp:27
    +
    Entity convenience class.
    Definition: entity.h:27
    +
    EntityManager()=default
    Default instance of an EntityManager.
    +
    Space that keeps track of all the entities, componenets and runs the systems on the data to update th...
    Definition: space.h:28
    +
    + + + + diff --git a/files.html b/files.html index 49daa642..4542bb4a 100644 --- a/files.html +++ b/files.html @@ -8,13 +8,6 @@ - - - - -
     |\*vertex.h
    - o-math - |\*matrix.h
    + o-engine + |o*component.h
    + + |o*engine.cpp
    + + |o*engine.h
    + + |o*entity.cpp
    + + |o*entity.h
    + + |o*entitymanager.cpp
    - o-physics - |o*body.cpp
    + |o*entitymanager.h
    - |o*body.h
    + |o*space.cpp
    - |o*collider.h
    + |o*space.h
    - |o*collisionbody.h
    + |\*system.h
    - |o*particlebody.cpp
    + o-math + |\*matrix.h
    - |o*particlebody.h
    + o-physics + |o*body.cpp
    - |o*physics.h
    + |o*body.h
    - |o*rectanglecollider.cpp
    + |o*collider.h
    - |o*rectanglecollider.h
    + |o*collisionbody.h
    - |o*rigidbody.cpp
    + |o*particlebody.cpp
    - |\*rigidbody.h
    + |o*particlebody.h
    - o-render - |o*batch.h - |o*drawable.h - |o*ellipse.h - |o*rectangle.cpp - |o*rectangle.h - |o*shader.cpp
    + |o*physics.h
    - |o*shader.h
    + |o*rectanglecollider.cpp
    - |o*shape.h - |o*sprite.cpp
    + |o*rectanglecollider.h
    - |o*sprite.h
    + |o*rigidbody.cpp
    - |o*spritebatch.cpp
    + |\*rigidbody.h
    - |\*spritebatch.h
    + o-render + |o*batch.h
    - o-util - |o*active.cpp
    + |o*drawable.h
    - |o*active.h
    + |o*ellipse.h
    - |\*syncqueue.h
    + |o*rectangle.cpp
    - o*yage.cpp
    + |o*rectangle.h
    - \*yage.h
    + |o*shader.cpp
    + + |o*shader.h
    + + |o*shape.h
    + + |o*sprite.cpp
    + + |o*sprite.h
    + + |o*spritebatch.cpp
    + + |\*spritebatch.h
    + + o-util + |o*active.cpp
    + + |o*active.h
    + + |\*syncqueue.h
    + + o*yage.cpp
    + + \*yage.h
    - - + diff --git a/files.js b/files.js deleted file mode 100644 index 32b5aa1d..00000000 --- a/files.js +++ /dev/null @@ -1,4 +0,0 @@ -var files = -[ - [ "yage", "dir_0a5be4b85c8e2c05f7a9f5a803f53125.html", "dir_0a5be4b85c8e2c05f7a9f5a803f53125" ] -]; \ No newline at end of file diff --git a/ftv2cl.png b/ftv2cl.png index 132f6577..3ca0f3b6 100644 Binary files a/ftv2cl.png and b/ftv2cl.png differ diff --git a/ftv2doc.png b/ftv2doc.png index 17edabff..321d92d1 100644 Binary files a/ftv2doc.png and b/ftv2doc.png differ diff --git a/ftv2folderclosed.png b/ftv2folderclosed.png index bb8ab35e..e951ffd3 100644 Binary files a/ftv2folderclosed.png and b/ftv2folderclosed.png differ diff --git a/ftv2folderopen.png b/ftv2folderopen.png index d6c7f676..593a54fa 100644 Binary files a/ftv2folderopen.png and b/ftv2folderopen.png differ diff --git a/ftv2link.png b/ftv2link.png index 17edabff..321d92d1 100644 Binary files a/ftv2link.png and b/ftv2link.png differ diff --git a/ftv2mlastnode.png b/ftv2mlastnode.png index 0b63f6d3..c3a27de1 100644 Binary files a/ftv2mlastnode.png and b/ftv2mlastnode.png differ diff --git a/ftv2mnode.png b/ftv2mnode.png index 0b63f6d3..c3a27de1 100644 Binary files a/ftv2mnode.png and b/ftv2mnode.png differ diff --git a/ftv2mo.png b/ftv2mo.png index 4bfb80f7..7623f9a5 100644 Binary files a/ftv2mo.png and b/ftv2mo.png differ diff --git a/ftv2ns.png b/ftv2ns.png index 72e3d71c..73081b11 100644 Binary files a/ftv2ns.png and b/ftv2ns.png differ diff --git a/ftv2plastnode.png b/ftv2plastnode.png index c6ee22f9..0828d7c3 100644 Binary files a/ftv2plastnode.png and b/ftv2plastnode.png differ diff --git a/ftv2pnode.png b/ftv2pnode.png index c6ee22f9..0828d7c3 100644 Binary files a/ftv2pnode.png and b/ftv2pnode.png differ diff --git a/ftv2splitbar.png b/ftv2splitbar.png index fe895f2c..50c780f6 100644 Binary files a/ftv2splitbar.png and b/ftv2splitbar.png differ diff --git a/functions.html b/functions.html index 2e997e80..6c84ce65 100644 --- a/functions.html +++ b/functions.html @@ -8,13 +8,6 @@ - - - - -
    add() : yage::Logger +
  • addSystem() +: yage::Engine +
  • applyForce() : yage::Body , yage::ParticleBody
  • -
    - + diff --git a/functions_b.html b/functions_b.html index 54a19ae3..ebbf0c8d 100644 --- a/functions_b.html +++ b/functions_b.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_c.html b/functions_c.html index 65c39731..3e665de3 100644 --- a/functions_c.html +++ b/functions_c.html @@ -8,13 +8,6 @@ - - - - -
    yage::Matrix< Rows, Cols, Type >
  • Coordinate() -: yage::details::Coordinate +: yage::details::Coordinate
  • create() : yage::Active , yage::Window
  • +
  • createEntity() +: yage::EntityManager +, yage::Space +
  • +
  • createEntityInstance() +: yage::EntityManager +
  • -
    - + diff --git a/functions_d.html b/functions_d.html index 8f3e72be..8d60731d 100644 --- a/functions_d.html +++ b/functions_d.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_dup.js b/functions_dup.js deleted file mode 100644 index 9dcc0689..00000000 --- a/functions_dup.js +++ /dev/null @@ -1,28 +0,0 @@ -var functions_dup = -[ - [ "a", "functions.html", null ], - [ "b", "functions_b.html", null ], - [ "c", "functions_c.html", null ], - [ "d", "functions_d.html", null ], - [ "e", "functions_e.html", null ], - [ "f", "functions_f.html", null ], - [ "g", "functions_g.html", null ], - [ "h", "functions_h.html", null ], - [ "i", "functions_i.html", null ], - [ "k", "functions_k.html", null ], - [ "l", "functions_l.html", null ], - [ "m", "functions_m.html", null ], - [ "n", "functions_n.html", null ], - [ "o", "functions_o.html", null ], - [ "p", "functions_p.html", null ], - [ "r", "functions_r.html", null ], - [ "s", "functions_s.html", null ], - [ "t", "functions_t.html", null ], - [ "u", "functions_u.html", null ], - [ "v", "functions_v.html", null ], - [ "w", "functions_w.html", null ], - [ "x", "functions_x.html", null ], - [ "y", "functions_y.html", null ], - [ "z", "functions_z.html", null ], - [ "~", "functions_~.html", null ] -]; \ No newline at end of file diff --git a/functions_e.html b/functions_e.html index d5c7a36b..69fdcd69 100644 --- a/functions_e.html +++ b/functions_e.html @@ -8,13 +8,6 @@ - - - - -
    yage::Matrix< Rows, Cols, Type > , yage::SpriteBatch +
  • Entity() +: yage::Entity +
  • +
  • EntityManager() +: yage::EntityManager +
  • eof : stbi_io_callbacks
  • -
    - + diff --git a/functions_f.html b/functions_f.html index f0938e22..18a6be44 100644 --- a/functions_f.html +++ b/functions_f.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_func.html b/functions_func.html index 80333dc0..523891eb 100644 --- a/functions_func.html +++ b/functions_func.html @@ -8,13 +8,6 @@ - - - - -
    add() : yage::Logger +
  • addSystem() +: yage::Engine +
  • applyForce() : yage::Body , yage::ParticleBody @@ -204,6 +187,13 @@ $(document).ready(function(){initNavTree('functions_func.html','');}); : yage::Active , yage::Window
  • +
  • createEntity() +: yage::EntityManager +, yage::Space +
  • +
  • createEntityInstance() +: yage::EntityManager +
  • @@ -222,6 +212,12 @@ $(document).ready(function(){initNavTree('functions_func.html','');}); , yage::Matrix< Rows, Cols, Type > , yage::SpriteBatch +
  • Entity() +: yage::Entity +
  • +
  • EntityManager() +: yage::EntityManager +
  • @@ -239,6 +235,9 @@ $(document).ready(function(){initNavTree('functions_func.html','');});
  • getCol() : yage::Matrix< Rows, Cols, Type >
  • +
  • getHandle() +: yage::Entity +
  • getRow() : yage::Matrix< Rows, Cols, Type >
  • @@ -265,14 +264,17 @@ $(document).ready(function(){initNavTree('functions_func.html','');});

    - i -

    @@ -301,6 +303,9 @@ $(document).ready(function(){initNavTree('functions_func.html','');});

    - m -

    @@ -561,19 +571,19 @@ $(document).ready(function(){initNavTree('functions_func.html','');});
  • ~SpriteBatch() : yage::SpriteBatch
  • +
  • ~System() +: yage::System +
  • ~Window() : yage::Window
  • -
    - + diff --git a/functions_g.html b/functions_g.html index ea06f21e..f81c7c67 100644 --- a/functions_g.html +++ b/functions_g.html @@ -8,13 +8,6 @@ - - - - -
    getCol() : yage::Matrix< Rows, Cols, Type > +
  • getHandle() +: yage::Entity +
  • getRow() : yage::Matrix< Rows, Cols, Type >
  • @@ -174,14 +157,11 @@ $(document).ready(function(){initNavTree('functions_g.html','');});
    -
    - + diff --git a/functions_h.html b/functions_h.html index a177f537..d6b9aca1 100644 --- a/functions_h.html +++ b/functions_h.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_i.html b/functions_i.html index 79414ad9..051aec8b 100644 --- a/functions_i.html +++ b/functions_i.html @@ -8,13 +8,6 @@ - - - - -
  • init() : yage::Batch +, yage::Engine , yage::Sprite +, yage::System
  • inside() : yage::Collider , yage::RectangleCollider
  • instance() -: yage::Logger +: yage::Engine +, yage::Logger
  • -
    - + diff --git a/functions_k.html b/functions_k.html index bf1c6222..10a95794 100644 --- a/functions_k.html +++ b/functions_k.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_l.html b/functions_l.html index 519cdd17..6fd3bcb9 100644 --- a/functions_l.html +++ b/functions_l.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_m.html b/functions_m.html index 34357aae..dcf80a17 100644 --- a/functions_m.html +++ b/functions_m.html @@ -8,13 +8,6 @@ - - - - -
    Here is a list of all class members with links to the classes they belong to:

    - m -

    - - + diff --git a/functions_n.html b/functions_n.html index acd6beb5..b1d17902 100644 --- a/functions_n.html +++ b/functions_n.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_o.html b/functions_o.html index 2589fb27..f4feb575 100644 --- a/functions_o.html +++ b/functions_o.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_p.html b/functions_p.html index 408b70ee..ec03b9dc 100644 --- a/functions_p.html +++ b/functions_p.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_r.html b/functions_r.html index 031d357a..4150c3c3 100644 --- a/functions_r.html +++ b/functions_r.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_rela.html b/functions_rela.html index d3c83ad6..424e8b74 100644 --- a/functions_rela.html +++ b/functions_rela.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_s.html b/functions_s.html index 20294ca1..dc0246ec 100644 --- a/functions_s.html +++ b/functions_s.html @@ -8,13 +8,6 @@ - - - - -
    skip : stbi_io_callbacks +
  • Space() +: yage::Space +
  • Sprite() : yage::Sprite
  • @@ -196,18 +179,15 @@ $(document).ready(function(){initNavTree('functions_s.html','');}); : yage::Window
  • SyncQueue() -: yage::SyncQueue< T > +: yage::SyncQueue< T >
  • -
    - + diff --git a/functions_t.html b/functions_t.html index 90438675..b7732f98 100644 --- a/functions_t.html +++ b/functions_t.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_type.html b/functions_type.html index 94e9208f..11b29e9f 100644 --- a/functions_type.html +++ b/functions_type.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_u.html b/functions_u.html index e44089d8..fb793c8e 100644 --- a/functions_u.html +++ b/functions_u.html @@ -8,13 +8,6 @@ - - - - -
    update() : yage::Body , yage::Camera +, yage::Engine , yage::ParticleBody +, yage::System
  • use() : yage::Shader @@ -166,14 +148,11 @@ $(document).ready(function(){initNavTree('functions_u.html','');});
  • -
    - + diff --git a/functions_v.html b/functions_v.html index 8a7da7b5..2eadf032 100644 --- a/functions_v.html +++ b/functions_v.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_vars.html b/functions_vars.html index b11fa6f5..46d8a69f 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_w.html b/functions_w.html index c965a4b9..bce8fe93 100644 --- a/functions_w.html +++ b/functions_w.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_x.html b/functions_x.html index 16371b10..c1d86cfd 100644 --- a/functions_x.html +++ b/functions_x.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_y.html b/functions_y.html index b99e794d..075ec754 100644 --- a/functions_y.html +++ b/functions_y.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_z.html b/functions_z.html index 7d8e2079..a8b773ec 100644 --- a/functions_z.html +++ b/functions_z.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/functions_~.html b/functions_~.html index 43449186..8e2cce8d 100644 --- a/functions_~.html +++ b/functions_~.html @@ -8,13 +8,6 @@ - - - - -
    ~SpriteBatch() : yage::SpriteBatch +
  • ~System() +: yage::System +
  • ~Window() : yage::Window
  • -
    - + diff --git a/globals.html b/globals.html index 6baff45c..e22053ab 100644 --- a/globals.html +++ b/globals.html @@ -8,13 +8,6 @@ - - - - -
    Here is a list of all file members with links to the files they belong to:
    +

    - c -

    + +

    - f -

    +

    - n -

    + + +

    - p -

    + +

    - s -

    -
    - + diff --git a/globals_defs.html b/globals_defs.html index 6a316189..c79d544b 100644 --- a/globals_defs.html +++ b/globals_defs.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/globals_enum.html b/globals_enum.html new file mode 100644 index 00000000..d53d0f44 --- /dev/null +++ b/globals_enum.html @@ -0,0 +1,111 @@ + + + + + + +YAGE: File Members + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + +
    + +
    + All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
    + + +
    + +
    + +
    +
    + + + + diff --git a/globals_eval.html b/globals_eval.html index 86f46e82..1ddd76fd 100644 --- a/globals_eval.html +++ b/globals_eval.html @@ -8,13 +8,6 @@ - - - - -
     
    -
    - + diff --git a/globals_func.html b/globals_func.html index d769d536..f959511c 100644 --- a/globals_func.html +++ b/globals_func.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/globals_type.html b/globals_type.html index dcd0a7c7..195fbea0 100644 --- a/globals_type.html +++ b/globals_type.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/globals_vars.html b/globals_vars.html index ed55cd7b..ba3b0fdd 100644 --- a/globals_vars.html +++ b/globals_vars.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/hierarchy.html b/hierarchy.html index 20aaf235..b405c8c8 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -8,13 +8,6 @@ - - - - -
    oCyage::Collider |\Cyage::RectangleCollider oCyage::Colour -oCyage::details::Coordinate -oCyage::Drawable -|\Cyage::Shape -| \Cyage::Rectangle -oCyage::details::GlyphGlyph with information of the texture -oCyage::ImageLoader -oCyage::IoManager -oCyage::Logger

    Logger

    - -oCyage::LogMessage -oCyage::LogSink -oCyage::Matrix< Rows, Cols, Type >Base Matrix class used by other similar classes -oCyage::Matrix< Rows, 1, double > -|\Cyage::Vector< 2, double > -| \Cyage::Vector2< double > -oCyage::Matrix< Rows, 1, Type > -|oCyage::Vector< 2, Type > -||\Cyage::Vector2< Type >2D Vector class -|oCyage::Vector< 3, Type > -||\Cyage::Vector3< Type >3D Vector class -|oCyage::Vector< 4, Type > -||\Cyage::Vector4< Type >4D Vector class -|\Cyage::Vector< Rows, Type > -oCyage::LogMessage::Meta -oCyage::Position -oCyage::details::RenderBatch -oCyage::ResourceManager -oCyage::details::Row< Rows, Cols, Type > -oCyage::Shader -oCyage::Sprite -oCyage::SpriteBatch -oCyage::SpriteSheet -oCstbi_io_callbacks -oCyage::SyncQueue< T > -oCyage::SyncQueue< Callback > -oCyage::Texture -oCyage::TextureCache -oCyage::UV -oCyage::Vertex -\Cyage::Window +oCComponent +oCyage::details::Coordinate +oCyage::Drawable +|\Cyage::Shape +| \Cyage::Rectangle +oCyage::EngineMain engine class that contains a systems, the main loop and the update function that updates all the systems +oCyage::EntityEntity convenience class +oCyage::EntityManagerManages entities in a space +oCyage::details::GlyphGlyph with information of the texture +oCyage::ImageLoader +oCyage::IoManager +oCyage::Logger +oCyage::LogMessage +oCyage::LogSink +oCyage::Matrix< Rows, Cols, Type >Base Matrix class used by other similar classes +oCyage::Matrix< Rows, 1, double > +|\Cyage::Vector< 2, double > +| \Cyage::Vector2< double > +oCyage::Matrix< Rows, 1, Type > +|oCyage::Vector< 2, Type > +||\Cyage::Vector2< Type >2D Vector class +|oCyage::Vector< 3, Type > +||\Cyage::Vector3< Type >3D Vector class +|oCyage::Vector< 4, Type > +||\Cyage::Vector4< Type >4D Vector class +|\Cyage::Vector< Rows, Type > +oCyage::LogMessage::Meta +oCyage::Position +oCyage::details::RenderBatch +oCyage::ResourceManager +oCyage::details::Row< Rows, Cols, Type > +oCyage::Shader +oCyage::SpaceSpace that keeps track of all the entities, componenets and runs the systems on the data to update them +oCyage::Sprite +oCyage::SpriteBatch +oCyage::SpriteSheet +oCstbi_io_callbacks +oCyage::SyncQueue< T > +oCyage::SyncQueue< Callback > +oCyage::SystemSystem interface for the different systems in the engine +oCyage::Texture +oCyage::TextureCache +oCyage::UV +oCyage::Vertex +\Cyage::Window
    - - + diff --git a/hierarchy.js b/hierarchy.js deleted file mode 100644 index b42d6759..00000000 --- a/hierarchy.js +++ /dev/null @@ -1,63 +0,0 @@ -var hierarchy = -[ - [ "yage::Active", "classyage_1_1Active.html", null ], - [ "yage::Batch", "classyage_1_1Batch.html", null ], - [ "yage::Body", "classyage_1_1Body.html", [ - [ "yage::CollisionBody", "classyage_1_1CollisionBody.html", null ], - [ "yage::ParticleBody", "classyage_1_1ParticleBody.html", [ - [ "yage::RigidBody", "classyage_1_1RigidBody.html", null ] - ] ] - ] ], - [ "yage::Camera", "classyage_1_1Camera.html", null ], - [ "yage::Collider", "classyage_1_1Collider.html", [ - [ "yage::RectangleCollider", "classyage_1_1RectangleCollider.html", null ] - ] ], - [ "yage::Colour", "structyage_1_1Colour.html", null ], - [ "yage::details::Coordinate", "structyage_1_1details_1_1Coordinate.html", null ], - [ "yage::Drawable", "classyage_1_1Drawable.html", [ - [ "yage::Shape", "classyage_1_1Shape.html", [ - [ "yage::Rectangle", "classyage_1_1Rectangle.html", null ] - ] ] - ] ], - [ "yage::details::Glyph", "structyage_1_1details_1_1Glyph.html", null ], - [ "yage::ImageLoader", "classyage_1_1ImageLoader.html", null ], - [ "yage::IoManager", "classyage_1_1IoManager.html", null ], - [ "yage::Logger", "classyage_1_1Logger.html", null ], - [ "yage::LogMessage", "classyage_1_1LogMessage.html", null ], - [ "yage::LogSink", "classyage_1_1LogSink.html", null ], - [ "yage::Matrix< Rows, Cols, Type >", "classyage_1_1Matrix.html", null ], - [ "yage::Matrix< Rows, 1, double >", "classyage_1_1Matrix.html", [ - [ "yage::Vector< 2, double >", "classyage_1_1Vector.html", [ - [ "yage::Vector2< double >", "classyage_1_1Vector2.html", null ] - ] ] - ] ], - [ "yage::Matrix< Rows, 1, Type >", "classyage_1_1Matrix.html", [ - [ "yage::Vector< 2, Type >", "classyage_1_1Vector.html", [ - [ "yage::Vector2< Type >", "classyage_1_1Vector2.html", null ] - ] ], - [ "yage::Vector< 3, Type >", "classyage_1_1Vector.html", [ - [ "yage::Vector3< Type >", "classyage_1_1Vector3.html", null ] - ] ], - [ "yage::Vector< 4, Type >", "classyage_1_1Vector.html", [ - [ "yage::Vector4< Type >", "classyage_1_1Vector4.html", null ] - ] ], - [ "yage::Vector< Rows, Type >", "classyage_1_1Vector.html", null ] - ] ], - [ "yage::LogMessage::Meta", "structyage_1_1LogMessage_1_1Meta.html", null ], - [ "yage::Position", "structyage_1_1Position.html", null ], - [ "yage::details::RenderBatch", "structyage_1_1details_1_1RenderBatch.html", null ], - [ "yage::ResourceManager", "classyage_1_1ResourceManager.html", null ], - [ "yage::details::Row< Rows, Cols, Type >", "classyage_1_1details_1_1Row.html", null ], - [ "yage::Shader", "classyage_1_1Shader.html", null ], - [ "yage::Sprite", "classyage_1_1Sprite.html", null ], - [ "yage::SpriteBatch", "classyage_1_1SpriteBatch.html", null ], - [ "yage::SpriteSheet", "classyage_1_1SpriteSheet.html", null ], - [ "stbi_io_callbacks", "structstbi__io__callbacks.html", null ], - [ "yage::SyncQueue< T >", "classyage_1_1SyncQueue.html", null ], - [ "yage::SyncQueue< Callback >", "classyage_1_1SyncQueue.html", null ], - [ "yage::Texture", "structyage_1_1Texture.html", null ], - [ "yage::TextureCache", "classyage_1_1TextureCache.html", null ], - [ "yage::UV", "structyage_1_1UV.html", null ], - [ "yage::Vertex", "structyage_1_1Vertex.html", null ], - [ "yage::Window", "classyage_1_1Window.html", null ] -]; \ No newline at end of file diff --git a/imageloader_8cpp.html b/imageloader_8cpp.html index f8923209..a3b54608 100644 --- a/imageloader_8cpp.html +++ b/imageloader_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces
    @@ -125,7 +109,7 @@ $(document).ready(function(){initNavTree('imageloader_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -133,15 +117,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/imageloader_8h.html b/imageloader_8h.html index 4a7df645..41483581 100644 --- a/imageloader_8h.html +++ b/imageloader_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -127,7 +111,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -135,15 +119,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/imageloader_8h_source.html b/imageloader_8h_source.html index efccb44a..33f1786d 100644 --- a/imageloader_8h_source.html +++ b/imageloader_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    imageloader.h
    @@ -132,15 +116,11 @@ $(document).ready(function(){initNavTree('imageloader_8h_source.html','');});
    static Texture loadPng(const std::string &file_path)
    Definition: imageloader.cpp:22
    Definition: texture.h:17
    - - + diff --git a/index.html b/index.html index 1b785fc3..a8deb751 100644 --- a/index.html +++ b/index.html @@ -8,13 +8,6 @@ - - - - -
    YAGE
    -
    -master-build -
    -

    Introduction

    -

    YAGE stands for Yet Another Game Engine. It is a game engine that is being developed for a game called Arider. It uses OpenGL and GLFW for the window creation and management and graphics. It is also going to be a general game engine for use with other games in the similar style.

    -

    The inspiration for this game engine is to learn about OpenGL and create an optimised 2D game engine with a simple API that can be used to easily create simple 2D games.

    -

    The full documentation can be seen here.

    -

    Installation and usage

    -

    To use YAGE for your own game, you should link it as a static library and include the yage.h header in your project. To link the project using cmake, the library has to be added as a subdirectory and then linked with the name yage.

    -

    Build and Testing

    -

    To compile YAGE, create a build directory from the base dirqectory. Then call cmake and point it to the directory containing. CMakeLists.txt. For example, one can use the following commands

    -

    ``` shell mkdir -p build cd build cmake .. ```

    -

    The test suite can then be run using

    -

    ``` shell cd build/tests && ctest ```

    +

    YAGE (Yet Another Game Engine) is a game engine that was written to learn about graphics and eventually be used to program games. It focuses mostly on tile based 2D games but it will eventually be expanded to handle orthographic views and finally full 3D.

    +

    Guides

    +

    Below are some guides for different aspects of the game engine and how to use it.

    +

    License

    -

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om – MIT License, see file LICENSE for more details.

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om MIT License, see LICENSE file for more details.

    -
    - + diff --git a/input_8h.html b/input_8h.html index 3993b952..7d4e1a6e 100644 --- a/input_8h.html +++ b/input_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces | @@ -123,7 +107,7 @@ $(document).ready(function(){initNavTree('input_8h.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
      - - + diff --git a/input_8h.js b/input_8h.js deleted file mode 100644 index 01947691..00000000 --- a/input_8h.js +++ /dev/null @@ -1,128 +0,0 @@ -var input_8h = -[ - [ "GLFW_INCLUDE_NONE", "input_8h.html#a088324ad8995e3eb76024e3e79083d48", null ], - [ "key", "input_8h.html#ad5a9307442e5daa8810aff942564a822", [ - [ "UNKNOWN", "input_8h.html#ad5a9307442e5daa8810aff942564a822a696b031073e74bf2cb98e5ef201d4aa3", null ], - [ "SPACE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a6506ae39fdca9845e3a6de3865183e57", null ], - [ "APOSTROPHE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a9df35983f4024e31955de0f1e545e888", null ], - [ "COMMA", "input_8h.html#ad5a9307442e5daa8810aff942564a822a4d9b3e9fc12849d060371eb65154c751", null ], - [ "MINUS", "input_8h.html#ad5a9307442e5daa8810aff942564a822affc0d9b54a1fe677c4c9e6b050e67c81", null ], - [ "PERIOD", "input_8h.html#ad5a9307442e5daa8810aff942564a822ade58a28573783fe95304a260ccd90362", null ], - [ "SLASH", "input_8h.html#ad5a9307442e5daa8810aff942564a822a646da671ca01bb5d84dbb5fb2238dc8e", null ], - [ "NUM0", "input_8h.html#ad5a9307442e5daa8810aff942564a822a22517dfceb401f35b1b59999ba74c700", null ], - [ "NUM1", "input_8h.html#ad5a9307442e5daa8810aff942564a822a71ddb986230a88155bf74e65f644dda4", null ], - [ "NUM2", "input_8h.html#ad5a9307442e5daa8810aff942564a822a78232351eaf00755d136afad0745157b", null ], - [ "NUM3", "input_8h.html#ad5a9307442e5daa8810aff942564a822acf6d2dfd5fb43f33ec09dbad7a90593c", null ], - [ "NUM4", "input_8h.html#ad5a9307442e5daa8810aff942564a822abb4e75dde7d107cc573c77dc42a7acab", null ], - [ "NUM5", "input_8h.html#ad5a9307442e5daa8810aff942564a822a6e2e9ebea6f89bc9235928b0794bc261", null ], - [ "NUM6", "input_8h.html#ad5a9307442e5daa8810aff942564a822aa8ecc4d78b0864cd22b788de2b48921f", null ], - [ "NUM7", "input_8h.html#ad5a9307442e5daa8810aff942564a822a65d3215a061ffc8962994cdf549e31e4", null ], - [ "NUM8", "input_8h.html#ad5a9307442e5daa8810aff942564a822ac63bd90003103ca242fe9202fe10c3e9", null ], - [ "NUM9", "input_8h.html#ad5a9307442e5daa8810aff942564a822abb2cbd684a16faa1624ae1b3a4ceaa2c", null ], - [ "SEMICOLON", "input_8h.html#ad5a9307442e5daa8810aff942564a822abaaceccc27b1d4e0968c999583f97de5", null ], - [ "EQUAL", "input_8h.html#ad5a9307442e5daa8810aff942564a822a969f331a87d8c958473c32b4d0e61a44", null ], - [ "A", "input_8h.html#ad5a9307442e5daa8810aff942564a822a7fc56270e7a70fa81a5935b72eacbe29", null ], - [ "B", "input_8h.html#ad5a9307442e5daa8810aff942564a822a9d5ed678fe57bcca610140957afab571", null ], - [ "C", "input_8h.html#ad5a9307442e5daa8810aff942564a822a0d61f8370cad1d412f80b84d143e1257", null ], - [ "D", "input_8h.html#ad5a9307442e5daa8810aff942564a822af623e75af30e62bbd73d6df5b50bb7b5", null ], - [ "E", "input_8h.html#ad5a9307442e5daa8810aff942564a822a3a3ea00cfc35332cedf6e5e9a32e94da", null ], - [ "F", "input_8h.html#ad5a9307442e5daa8810aff942564a822a800618943025315f869e4e1f09471012", null ], - [ "G", "input_8h.html#ad5a9307442e5daa8810aff942564a822adfcf28d0734569a6a693bc8194de62bf", null ], - [ "H", "input_8h.html#ad5a9307442e5daa8810aff942564a822ac1d9f50f86825a1a2302ec2449c17196", null ], - [ "I", "input_8h.html#ad5a9307442e5daa8810aff942564a822add7536794b63bf90eccfd37f9b147d7f", null ], - [ "J", "input_8h.html#ad5a9307442e5daa8810aff942564a822aff44570aca8241914870afbc310cdb85", null ], - [ "K", "input_8h.html#ad5a9307442e5daa8810aff942564a822aa5f3c6a11b03839d46af9fb43c97c188", null ], - [ "L", "input_8h.html#ad5a9307442e5daa8810aff942564a822ad20caec3b48a1eef164cb4ca81ba2587", null ], - [ "M", "input_8h.html#ad5a9307442e5daa8810aff942564a822a69691c7bdcc3ce6d5d8a1361f22d04ac", null ], - [ "N", "input_8h.html#ad5a9307442e5daa8810aff942564a822a8d9c307cb7f3c4a32822a51922d1ceaa", null ], - [ "O", "input_8h.html#ad5a9307442e5daa8810aff942564a822af186217753c37b9b9f958d906208506e", null ], - [ "P", "input_8h.html#ad5a9307442e5daa8810aff942564a822a44c29edb103a2872f519ad0c9a0fdaaa", null ], - [ "Q", "input_8h.html#ad5a9307442e5daa8810aff942564a822af09564c9ca56850d4cd6b3319e541aee", null ], - [ "R", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae1e1d3d40573127e9ee0480caf1283d6", null ], - [ "S", "input_8h.html#ad5a9307442e5daa8810aff942564a822a5dbc98dcc983a70728bd082d1a47546e", null ], - [ "T", "input_8h.html#ad5a9307442e5daa8810aff942564a822ab9ece18c950afbfa6b0fdbfa4ff731d3", null ], - [ "U", "input_8h.html#ad5a9307442e5daa8810aff942564a822a4c614360da93c0a041b22e537de151eb", null ], - [ "V", "input_8h.html#ad5a9307442e5daa8810aff942564a822a5206560a306a2e085a437fd258eb57ce", null ], - [ "W", "input_8h.html#ad5a9307442e5daa8810aff942564a822a61e9c06ea9a85a5088a499df6458d276", null ], - [ "X", "input_8h.html#ad5a9307442e5daa8810aff942564a822a02129bb861061d1a052c592e2dc6b383", null ], - [ "Y", "input_8h.html#ad5a9307442e5daa8810aff942564a822a57cec4137b614c87cb4e24a3d003a3e0", null ], - [ "Z", "input_8h.html#ad5a9307442e5daa8810aff942564a822a21c2e59531c8710156d34a3c30ac81d5", null ], - [ "LEfT_BRACKET", "input_8h.html#ad5a9307442e5daa8810aff942564a822a91a9360a45bb242906ee86ecbf9ac7c4", null ], - [ "BACKSLASH", "input_8h.html#ad5a9307442e5daa8810aff942564a822aecb4a6f3440c2ed0dff59f17375a27c0", null ], - [ "RIGHT_BRACKET", "input_8h.html#ad5a9307442e5daa8810aff942564a822a91d8d0b84f26c3e30fb064ea4fc1090f", null ], - [ "GRAVE_ACCENT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a1547ad05c44be2cc614be32159bf666b", null ], - [ "WORLD_1", "input_8h.html#ad5a9307442e5daa8810aff942564a822a1ab6dcd85380f2d3e882fbd2f6fda566", null ], - [ "WORLD_2", "input_8h.html#ad5a9307442e5daa8810aff942564a822acb8104ace1979f9537c7f40de0622a22", null ], - [ "ESCAPE", "input_8h.html#ad5a9307442e5daa8810aff942564a822adaaedac409335b869929ea43fa44be5d", null ], - [ "ENTER", "input_8h.html#ad5a9307442e5daa8810aff942564a822a331b3100a485d8cacff1d3df8e9b0c13", null ], - [ "TAB", "input_8h.html#ad5a9307442e5daa8810aff942564a822af684bf05fa3e81528c84d1d281d839f1", null ], - [ "BACKSPACE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a6f5d8e41084b4d3d47fa621c459eede1", null ], - [ "INSERT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a61ee777e7f71dc466c3b2c685d8d313b", null ], - [ "DELETE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a32f68a60cef40faedbc6af20298c1a1e", null ], - [ "RIGHT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a21507b40c80068eda19865706fdc2403", null ], - [ "LEFT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a684d325a7303f52e64011467ff5c5758", null ], - [ "DOWN", "input_8h.html#ad5a9307442e5daa8810aff942564a822ac4e0e4e3118472beeb2ae75827450f1f", null ], - [ "UP", "input_8h.html#ad5a9307442e5daa8810aff942564a822afbaedde498cdead4f2780217646e9ba1", null ], - [ "PAGE_UP", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae791d936f894ce58dd18bf603edcb9b4", null ], - [ "PAGE_DOWN", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae9a23c5ce3d34b40123d65ca14b2e88f", null ], - [ "HOME", "input_8h.html#ad5a9307442e5daa8810aff942564a822a710533dd879dd1202e5c73b27705bf02", null ], - [ "END", "input_8h.html#ad5a9307442e5daa8810aff942564a822ab1a326c06d88bf042f73d70f50197905", null ], - [ "CAPS_LOCK", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae40af1d5cc55c55ae0bb25953f7a7ee2", null ], - [ "SCROLL_LOCK", "input_8h.html#ad5a9307442e5daa8810aff942564a822a324bf1f059b99e2882bc1d567080d8ed", null ], - [ "NUM_LOCK", "input_8h.html#ad5a9307442e5daa8810aff942564a822acb0d0bf9279e78f982deba761110e434", null ], - [ "PRINT_SCREEN", "input_8h.html#ad5a9307442e5daa8810aff942564a822a853f8ded7a96b5a765704974e6a3ca96", null ], - [ "PAUSE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a291554596c183e837f0a6bec3767c891", null ], - [ "F1", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae1dffc8709f31a4987c8a88334107e89", null ], - [ "F2", "input_8h.html#ad5a9307442e5daa8810aff942564a822afe5c3684dce76cdd9f7f42430868aa74", null ], - [ "F3", "input_8h.html#ad5a9307442e5daa8810aff942564a822a4b6bf4b531770872d4328ce69bef5627", null ], - [ "F4", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae7e0e72401a9f2718ed0f39f2861d702", null ], - [ "F5", "input_8h.html#ad5a9307442e5daa8810aff942564a822a37f438df6a6d5ba4c17ef8ca58562f00", null ], - [ "F6", "input_8h.html#ad5a9307442e5daa8810aff942564a822a1faf42f2823f184eb2c9f0dffe5d73f2", null ], - [ "F7", "input_8h.html#ad5a9307442e5daa8810aff942564a822a47489eb597b7db34caa24b1fc78fc839", null ], - [ "F8", "input_8h.html#ad5a9307442e5daa8810aff942564a822a4787509ad9f9d747a81a30e9dde3d4a7", null ], - [ "F9", "input_8h.html#ad5a9307442e5daa8810aff942564a822a892a245e287c163080b23db737d3c4c9", null ], - [ "F10", "input_8h.html#ad5a9307442e5daa8810aff942564a822ab213ce22ca6ad4eda8db82966b9b6e5a", null ], - [ "F11", "input_8h.html#ad5a9307442e5daa8810aff942564a822a643b0662422d1d0dffa3fca2e2bf28a8", null ], - [ "F12", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae902674982fc99aa343cdd94da7476c3", null ], - [ "F13", "input_8h.html#ad5a9307442e5daa8810aff942564a822a95dfde4807d4d6a9eec499203b3c24a0", null ], - [ "F14", "input_8h.html#ad5a9307442e5daa8810aff942564a822a2468649b6215c4cdd2aef5095b3f5932", null ], - [ "F15", "input_8h.html#ad5a9307442e5daa8810aff942564a822ae53b55851b9ff4979f2c3ff434a4a138", null ], - [ "F16", "input_8h.html#ad5a9307442e5daa8810aff942564a822a56d8353718e6fdc78b8d69078a2cdb94", null ], - [ "F17", "input_8h.html#ad5a9307442e5daa8810aff942564a822affa5882d1ddcf903bf0d0dbc30bfc604", null ], - [ "F18", "input_8h.html#ad5a9307442e5daa8810aff942564a822a810b30cdfc07fd7fff553a94b828ff78", null ], - [ "F19", "input_8h.html#ad5a9307442e5daa8810aff942564a822acd7c2a221ef5d0a34acc0bcd679b2054", null ], - [ "F20", "input_8h.html#ad5a9307442e5daa8810aff942564a822afc335adb3d69d3d8270769e1923ea4dc", null ], - [ "F21", "input_8h.html#ad5a9307442e5daa8810aff942564a822a77e9eee7c579eef5f3731ecf1053c02e", null ], - [ "F22", "input_8h.html#ad5a9307442e5daa8810aff942564a822a7fa06ead699fcbd63132370ffe13335a", null ], - [ "F23", "input_8h.html#ad5a9307442e5daa8810aff942564a822a889645d530078147e7dc69a9caadc31e", null ], - [ "F24", "input_8h.html#ad5a9307442e5daa8810aff942564a822aebd7820c520d05eca2d775c37d141273", null ], - [ "F25", "input_8h.html#ad5a9307442e5daa8810aff942564a822aabf9846f265ae3dea4bf9d740f5cb1aa", null ], - [ "KP_0", "input_8h.html#ad5a9307442e5daa8810aff942564a822affb2ce8868d49c78376bf7e76c88fd52", null ], - [ "KP_1", "input_8h.html#ad5a9307442e5daa8810aff942564a822afdcbdc22f7e22388bf5905c290bcfe4b", null ], - [ "KP_2", "input_8h.html#ad5a9307442e5daa8810aff942564a822a2d0bfa737eccfce7842cd2230eed6712", null ], - [ "KP_3", "input_8h.html#ad5a9307442e5daa8810aff942564a822a766b4a88cba7645629bac70fd01d8275", null ], - [ "KP_4", "input_8h.html#ad5a9307442e5daa8810aff942564a822a9c56f942b051ba23447e108e16a8b23b", null ], - [ "KP_5", "input_8h.html#ad5a9307442e5daa8810aff942564a822adc271d081ca9fcbefdc42998313398d8", null ], - [ "KP_6", "input_8h.html#ad5a9307442e5daa8810aff942564a822a2091809ab6bdbc0a1975bf61d6099748", null ], - [ "KP_7", "input_8h.html#ad5a9307442e5daa8810aff942564a822a71f42e8faf0fb7cb14174c8481461c00", null ], - [ "KP_8", "input_8h.html#ad5a9307442e5daa8810aff942564a822a62e75b78c155e8549c5c5edb434a7757", null ], - [ "KP_9", "input_8h.html#ad5a9307442e5daa8810aff942564a822a3d548437292c0cd1662fc30d420f2c27", null ], - [ "KP_DECIMAL", "input_8h.html#ad5a9307442e5daa8810aff942564a822a1a9c94725005bc4759507db8acc8da33", null ], - [ "KP_DIVIDE", "input_8h.html#ad5a9307442e5daa8810aff942564a822a7c333963ed187368820c5343b355e5bc", null ], - [ "KP_MULTIPLY", "input_8h.html#ad5a9307442e5daa8810aff942564a822a2140df7839a3713724b35168defcc975", null ], - [ "KP_SUBTRACT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a17de1e647789892e1fb512bf04db4866", null ], - [ "KP_ADD", "input_8h.html#ad5a9307442e5daa8810aff942564a822a30808a0391df7790292aa5c13f6195e4", null ], - [ "KP_ENTER", "input_8h.html#ad5a9307442e5daa8810aff942564a822adea24610606fb34c587a8fe8ed8f8389", null ], - [ "KP_EQUAL", "input_8h.html#ad5a9307442e5daa8810aff942564a822a2cfe3b4f9911c5899d79f171d6b9cc4a", null ], - [ "LEFT_SHIFT", "input_8h.html#ad5a9307442e5daa8810aff942564a822ab6c7e6204e97690efd79d6f513ed5613", null ], - [ "LEFT_CONTROL", "input_8h.html#ad5a9307442e5daa8810aff942564a822addf133566f544b297f2f84874c283589", null ], - [ "LEFT_ALT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a3a92f3bbf26e4ea5ea7ce7db2f432c56", null ], - [ "LEFT_SUPER", "input_8h.html#ad5a9307442e5daa8810aff942564a822afd816cf0346d4939b4cf3bed78dd7fde", null ], - [ "RIGHT_SHIFT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a63a707029860972efa1c44ac6016e098", null ], - [ "RIGHT_CONTROL", "input_8h.html#ad5a9307442e5daa8810aff942564a822a80cdb34a10d276950f8b20b6814c9194", null ], - [ "RIGHT_ALT", "input_8h.html#ad5a9307442e5daa8810aff942564a822a0123827c03dce5d07ebd43bd649a1073", null ], - [ "RIGHT_SUPER", "input_8h.html#ad5a9307442e5daa8810aff942564a822a8825bb5d58b44b72465799553acb964d", null ], - [ "MENU", "input_8h.html#ad5a9307442e5daa8810aff942564a822a3ed53fbeb1eab0443561b68ca0c0b5cf", null ], - [ "LAST", "input_8h.html#ad5a9307442e5daa8810aff942564a822af447f5c03508de4d88e340390ba7c78f", null ] - ] ] -]; \ No newline at end of file diff --git a/input_8h_source.html b/input_8h_source.html index c1d50815..1ed993e7 100644 --- a/input_8h_source.html +++ b/input_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    input.h
    @@ -376,15 +360,11 @@ $(document).ready(function(){initNavTree('input_8h_source.html','');});
    - - + diff --git a/iomanager_8cpp.html b/iomanager_8cpp.html index 047585fe..43f8e24f 100644 --- a/iomanager_8cpp.html +++ b/iomanager_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -121,7 +105,7 @@ $(document).ready(function(){initNavTree('iomanager_8cpp.html','');});
    - +

    @@ -308,15 +292,11 @@ Enumerations

    Namespaces

     yage
     Project namespace.
     Core includes.
     

    Detailed Description

    @@ -129,15 +113,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/iomanager_8h.html b/iomanager_8h.html index 62fe76d2..29d07fa5 100644 --- a/iomanager_8h.html +++ b/iomanager_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/iomanager_8h_source.html b/iomanager_8h_source.html index 1f52c3dc..9cc73de4 100644 --- a/iomanager_8h_source.html +++ b/iomanager_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    iomanager.h
    @@ -131,15 +115,11 @@ $(document).ready(function(){initNavTree('iomanager_8h_source.html','');});
    static bool readFileToBuffer(const std::string &file_path, std::vector< unsigned char > &buffer)
    Definition: iomanager.cpp:17
    Definition: iomanager.h:18
    - - + diff --git a/jquery.js b/jquery.js index 3db33e62..c197801c 100644 --- a/jquery.js +++ b/jquery.js @@ -29,44 +29,3 @@ ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
    ").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b })}})(window); -/*! - * jQuery UI 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! - * jQuery UI Widget 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! - * jQuery UI Mouse 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
    ');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null; -p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' + +
    @@ -125,7 +109,7 @@ $(document).ready(function(){initNavTree('logger_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -133,15 +117,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/logger_8dox.html b/logger_8dox.html deleted file mode 100644 index bb189d36..00000000 --- a/logger_8dox.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -YAGE: docs/logger.dox File Reference - - - - - - - - - - - - - -
    -
    - - - - - - -
    -
    YAGE -  v0.1.4.0 -
    -
    Yet Another Game Engine
    -
    -
    - - - - - -
    -
    - -
    -
    -
    - - - - - - diff --git a/logger_8h.html b/logger_8h.html index 1b7bb770..8040d16f 100644 --- a/logger_8h.html +++ b/logger_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -129,14 +113,12 @@ $(document).ready(function(){initNavTree('logger_8h.html','');});

    Classes

    class  yage::Logger

    Logger

    - More...
      - +

    Namespaces

     yage
     Project namespace.
     Core includes.
     
    - - + diff --git a/logger_8h.js b/logger_8h.js deleted file mode 100644 index 2daf6992..00000000 --- a/logger_8h.js +++ /dev/null @@ -1,10 +0,0 @@ -var logger_8h = -[ - [ "Logger", "classyage_1_1Logger.html", "classyage_1_1Logger" ], - [ "yLogDebug", "logger_8h.html#a0061fe08a4e2d9ed843a782044d3528f", null ], - [ "yLogError", "logger_8h.html#ac71f194a096b3d7b4cf4ec448ee8b87d", null ], - [ "yLogFatal", "logger_8h.html#a89062c0e6f5d9d0dd34553259c0fe00e", null ], - [ "yLogger", "logger_8h.html#a9055939896a9ae18d3a833c5023e98d1", null ], - [ "yLogInfo", "logger_8h.html#a17afd33b46d111ec5e97f20e2c667e2d", null ], - [ "yLogWarning", "logger_8h.html#ac26448787b9e07f1cf6e928e23ef9b7a", null ] -]; \ No newline at end of file diff --git a/logger_8h_source.html b/logger_8h_source.html index d3a23ecf..c7636d64 100644 --- a/logger_8h_source.html +++ b/logger_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    logger.h
    @@ -132,8 +116,8 @@ $(document).ready(function(){initNavTree('logger_8h_source.html','');});
    29  explicit Logger(LogLevel min_level);
    30  Logger(LogLevel min_level, const std::string &file_path);
    31 
    -
    32  LogMessage operator()(LogLevel level = LogLevel::INFO, const std::string &fileName = "",
    -
    33  int lineNum = -1);
    + +
    33  const std::string &fileName = "", int lineNum = -1);
    34 
    35  void flush(const LogMessage *msg);
    36  void add(const LogSink &sink);
    @@ -158,43 +142,40 @@ $(document).ready(function(){initNavTree('logger_8h_source.html','');});
    55 #define yLogDebug \
    56  (yage::Logger::instance()(yage::LogLevel::DEBUG, __FILE__, __LINE__))
    57 
    -
    58 #define yLogInfo (yage::Logger::instance()(yage::LogLevel::INFO, __FILE__, __LINE__))
    -
    59 
    -
    60 #define yLogWarning \
    -
    61  (yage::Logger::instance()(yage::LogLevel::WARNING, __FILE__, __LINE__))
    -
    62 
    -
    63 #define yLogError \
    -
    64  (yage::Logger::instance()(yage::LogLevel::ERROR, __FILE__, __LINE__))
    -
    65 
    -
    66 #define yLogFatal \
    -
    67  (yage::Logger::instance()(yage::LogLevel::FATAL, __FILE__, __LINE__))
    -
    68 
    -
    69 #endif
    +
    58 #define yLogInfo \
    +
    59  (yage::Logger::instance()(yage::LogLevel::INFO, __FILE__, __LINE__))
    +
    60 
    +
    61 #define yLogWarning \
    +
    62  (yage::Logger::instance()(yage::LogLevel::WARNING, __FILE__, __LINE__))
    +
    63 
    +
    64 #define yLogError \
    +
    65  (yage::Logger::instance()(yage::LogLevel::ERROR, __FILE__, __LINE__))
    +
    66 
    +
    67 #define yLogFatal \
    +
    68  (yage::Logger::instance()(yage::LogLevel::FATAL, __FILE__, __LINE__))
    +
    69 
    +
    70 #endif
    Logger()
    Definition: logger.cpp:22
    Definition: logmessage.h:23
    -
    LogLevel
    Definition: loglevel.h:14
    +
    LogLevel
    Different log levels that can be assigned to each message sent to the Logger.
    Definition: loglevel.h:20
    void setLevel(LogLevel min_level)
    Definition: logger.cpp:95
    void clear()
    Definition: logger.cpp:83
    static Logger & instance()
    Definition: logger.cpp:88
    LogMessage operator()(LogLevel level=LogLevel::INFO, const std::string &fileName="", int lineNum=-1)
    Definition: logger.cpp:47
    -
    Logger
    Definition: logger.h:24
    +
    Definition: logger.h:24
    void flush(const LogMessage *msg)
    Definition: logger.cpp:53
    - +
    Information message.
    void add(const LogSink &sink)
    Definition: logger.cpp:69
    Definition: logsink.h:23
    - - + diff --git a/logger_8md.html b/logger_8md.html new file mode 100644 index 00000000..d7a9df51 --- /dev/null +++ b/logger_8md.html @@ -0,0 +1,99 @@ + + + + + + +YAGE: docs/logger.md File Reference + + + + + + + + + +
    +
    +

    @@ -232,15 +214,11 @@ Macros

    + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + +
    +
    +
    +
    docs/logger.md File Reference
    +
    +
    +
    + + + + diff --git a/logger_guide.html b/logger_guide.html new file mode 100644 index 00000000..578342b3 --- /dev/null +++ b/logger_guide.html @@ -0,0 +1,103 @@ + + + + + + +YAGE: Logger + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    +
    Logger
    +
    +
    +

    Aynchronous logging is built into the YAGE library, which can be used to log events in the game and also debug the game by using the debug output that the game engine produces. This can help if for example, a texture is being loaded.

    +

    Log levels

    +

    The logger has five different levels that can be assigned to a message. These are, from lowest to highest severity, DEBUG, INFO, WARNING, ERROR and FATAL, which are of type yage::LogLevel. Messages that the developer then wants to write to the logs can take any of these severities and the developer can then decide what the minimum severity is that the logger should log. By default, the logger will log anything that is above yage::LogLevel::INFO.

    +

    Using the Logger in your Game

    +

    There are a few preprocessor definitions to make the use of the logger as simple as possible. First of all, there is a definition to get the instance of the current global logger, which can then be used to set a different minimum display level. This definition is yLogger, and an example of how to use it to change the default output level can be seen below

    +

    ``` c++ yLogger.setLevel(yage::LogLevel::ERROR); ```

    +

    The above code changes the global logger so that it will only output things that are an error or fatal and make the engine crash.

    +

    Other preprocessor definitions are yLogDebug, yLogInfo, yLogWarning, yLogError and yLogFatal. These return an object that is similar to a buffer, but belongs to the main global logger yLogger. These are the definitions that should be used to print somehting to the main logger. For example

    +

    ``` c++ yLogWarning << "This is a warning"; ```

    +

    will print the message "This is a warning" with the severity of LogLevel::WARNING.

    +
    + + + + diff --git a/loglevel_8h.html b/loglevel_8h.html index cf46f069..0a20af3d 100644 --- a/loglevel_8h.html +++ b/loglevel_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces | @@ -121,7 +105,7 @@ $(document).ready(function(){initNavTree('loglevel_8h.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
        yage::LogLevel::FATAL
    } +

    @@ -135,6 +119,7 @@ Enumerations

     Different log levels that can be assigned to each message sent to the Logger. More...
     

    Detailed Description

    @@ -142,15 +127,11 @@ Enumerations

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/loglevel_8h.js b/loglevel_8h.js deleted file mode 100644 index 7f6cab17..00000000 --- a/loglevel_8h.js +++ /dev/null @@ -1,10 +0,0 @@ -var loglevel_8h = -[ - [ "LogLevel", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788", [ - [ "DEBUG", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788adc30ec20708ef7b0f641ef78b7880a15", null ], - [ "INFO", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a551b723eafd6a31d444fcb2f5920fbd3", null ], - [ "WARNING", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a059e9861e0400dfbe05c98a841f3f96b", null ], - [ "ERROR", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788abb1ca97ec761fc37101737ba0aa2e7c5", null ], - [ "FATAL", "loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a19da7170bea36556dde582519795f3fc", null ] - ] ] -]; \ No newline at end of file diff --git a/loglevel_8h_source.html b/loglevel_8h_source.html index f2d713bc..0b3eb6d3 100644 --- a/loglevel_8h_source.html +++ b/loglevel_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    loglevel.h
    @@ -112,35 +96,35 @@ $(document).ready(function(){initNavTree('loglevel_8h_source.html','');});
    9 #ifndef YAGE_CORE_LOGLEVEL_H
    10 #define YAGE_CORE_LOGLEVEL_H
    11 
    -
    12 namespace yage {
    -
    13 
    -
    14 enum class LogLevel {
    -
    15  DEBUG,
    -
    16  INFO,
    -
    17  WARNING,
    -
    18  ERROR,
    -
    19  FATAL,
    -
    20 };
    -
    21 
    -
    22 }
    -
    23 
    -
    24 #endif
    - - -
    LogLevel
    Definition: loglevel.h:14
    - - - +
    12 namespace yage
    +
    13 {
    +
    14 
    +
    20 enum class LogLevel {
    +
    23  DEBUG,
    +
    24 
    +
    26  INFO,
    +
    27 
    +
    29  WARNING,
    +
    30 
    +
    32  ERROR,
    +
    33 
    +
    36  FATAL,
    +
    37 };
    +
    38 }
    +
    39 
    +
    40 #endif
    +
    Warning message.
    +
    Fatal message that should be output when the game crashes.
    +
    LogLevel
    Different log levels that can be assigned to each message sent to the Logger.
    Definition: loglevel.h:20
    +
    Lowest log level. This is used by the game engine to output debugging information but is turned off i...
    +
    Error message.
    +
    Information message.
    - - + diff --git a/logmessage_8cpp.html b/logmessage_8cpp.html index e162c0ed..3ad1d61c 100644 --- a/logmessage_8cpp.html +++ b/logmessage_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -121,7 +105,7 @@ $(document).ready(function(){initNavTree('logmessage_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -129,15 +113,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/logmessage_8h.html b/logmessage_8h.html index d0fbc96a..0e4f37c1 100644 --- a/logmessage_8h.html +++ b/logmessage_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -132,7 +116,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -140,15 +124,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/logmessage_8h_source.html b/logmessage_8h_source.html index 6d47103c..2e69bed0 100644 --- a/logmessage_8h_source.html +++ b/logmessage_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    logmessage.h
    @@ -151,28 +135,29 @@ $(document).ready(function(){initNavTree('logmessage_8h_source.html','');});
    48  Logger *owner_;
    49  Meta meta_;
    50 
    -
    51  LogMessage(Logger *owner, LogLevel level, const std::string &file_name, int line_num);
    -
    52  LogMessage(LogMessage &&msg);
    -
    53 };
    -
    54 
    -
    55 /* -----------------------------------------------------------------------------
    -
    56  * Template definitions
    -
    57  * -----------------------------------------------------------------------------
    -
    58  */
    -
    59 
    -
    60 template <typename T>
    - -
    62 {
    -
    63  buffer_ << value;
    -
    64  return *this;
    -
    65 }
    -
    66 
    -
    67 } // namespace yage
    -
    68 
    -
    69 #endif
    +
    51  LogMessage(Logger *owner, LogLevel level, const std::string &file_name,
    +
    52  int line_num);
    +
    53  LogMessage(LogMessage &&msg);
    +
    54 };
    +
    55 
    +
    56 /* -----------------------------------------------------------------------------
    +
    57  * Template definitions
    +
    58  * -----------------------------------------------------------------------------
    +
    59  */
    +
    60 
    +
    61 template <typename T>
    + +
    63 {
    +
    64  buffer_ << value;
    +
    65  return *this;
    +
    66 }
    +
    67 
    +
    68 } // namespace yage
    +
    69 
    +
    70 #endif
    Definition: logmessage.h:23
    -
    LogLevel
    Definition: loglevel.h:14
    -
    LogMessage & operator<<(const T &value)
    Definition: logmessage.h:61
    +
    LogLevel
    Different log levels that can be assigned to each message sent to the Logger.
    Definition: loglevel.h:20
    +
    LogMessage & operator<<(const T &value)
    Definition: logmessage.h:62
    std::string fileName
    Definition: logmessage.h:40
    LogMessage(const LogMessage &msg)=delete
    @@ -180,19 +165,15 @@ $(document).ready(function(){initNavTree('logmessage_8h_source.html','');});
    LogLevel level
    Definition: logmessage.h:39
    -
    Logger
    Definition: logger.h:24
    +
    Definition: logger.h:24
    LogMessage & operator=(const LogMessage &msg)=delete
    Definition: logmessage.h:38
    - - + diff --git a/logsink_8cpp.html b/logsink_8cpp.html index ec64b5d0..f181445d 100644 --- a/logsink_8cpp.html +++ b/logsink_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces | @@ -125,7 +109,7 @@ $(document).ready(function(){initNavTree('logsink_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
      - - + diff --git a/logsink_8cpp.js b/logsink_8cpp.js deleted file mode 100644 index e101cbd1..00000000 --- a/logsink_8cpp.js +++ /dev/null @@ -1,7 +0,0 @@ -var logsink_8cpp = -[ - [ "makeConsoleSink", "logsink_8cpp.html#ab54350a8dbf59338c99ab4f43cfa2858", null ], - [ "makeFileSink", "logsink_8cpp.html#ad537beeea51c8314e407fadd24affc34", null ], - [ "makeFileSink", "logsink_8cpp.html#a6b288197f6a97f197dda60e5b54f1841", null ], - [ "fileHandle_", "logsink_8cpp.html#ae3c7a5bad8dd0db0a0a9cdd60c7b53d1", null ] -]; \ No newline at end of file diff --git a/logsink_8h.html b/logsink_8h.html index 0afcf248..02a395b2 100644 --- a/logsink_8h.html +++ b/logsink_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -130,7 +114,7 @@ Classes
    - +

    @@ -155,15 +139,11 @@ Functions

    Namespaces

     yage
     Project namespace.
     Core includes.
     

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/logsink_8h.js b/logsink_8h.js deleted file mode 100644 index a15a0e4d..00000000 --- a/logsink_8h.js +++ /dev/null @@ -1,7 +0,0 @@ -var logsink_8h = -[ - [ "LogSink", "classyage_1_1LogSink.html", "classyage_1_1LogSink" ], - [ "makeConsoleSink", "logsink_8h.html#ab54350a8dbf59338c99ab4f43cfa2858", null ], - [ "makeFileSink", "logsink_8h.html#ad537beeea51c8314e407fadd24affc34", null ], - [ "makeFileSink", "logsink_8h.html#a6b288197f6a97f197dda60e5b54f1841", null ] -]; \ No newline at end of file diff --git a/logsink_8h_source.html b/logsink_8h_source.html index c33204e0..7cb2b1d9 100644 --- a/logsink_8h_source.html +++ b/logsink_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    logsink.h
    @@ -205,15 +189,11 @@ $(document).ready(function(){initNavTree('logsink_8h_source.html','');});
    bool operator==(const LogSink &sink)
    Definition: logsink.cpp:36
    Definition: logsink.h:23
    - - + diff --git a/main_8md.html b/main_8md.html new file mode 100644 index 00000000..12ed0506 --- /dev/null +++ b/main_8md.html @@ -0,0 +1,99 @@ + + + + + + +YAGE: docs/main.md File Reference + + + + + + + + + +
    +
    +

    @@ -147,15 +131,11 @@ Functions

    + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + +
    +
    +
    +
    docs/main.md File Reference
    +
    +
    +
    + + + + diff --git a/matrix_8dox.html b/matrix_8dox.html deleted file mode 100644 index 822bd2f8..00000000 --- a/matrix_8dox.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -YAGE: docs/matrix.dox File Reference - - - - - - - - - - - - - -
    -
    - - - - - - -
    -
    YAGE -  v0.1.4.0 -
    -
    Yet Another Game Engine
    -
    -
    - - - - - -
    -
    - -
    -
    -
    - - - - - - diff --git a/matrix_8h.html b/matrix_8h.html index 569da623..da8c2dcd 100644 --- a/matrix_8h.html +++ b/matrix_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -151,7 +135,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
       yage::details   @@ -236,15 +220,11 @@ Functions

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/matrix_8h.js b/matrix_8h.js deleted file mode 100644 index ac0bfcd0..00000000 --- a/matrix_8h.js +++ /dev/null @@ -1,33 +0,0 @@ -var matrix_8h = -[ - [ "Matrix", "classyage_1_1Matrix.html", "classyage_1_1Matrix" ], - [ "Row", "classyage_1_1details_1_1Row.html", "classyage_1_1details_1_1Row" ], - [ "Matrix", "classyage_1_1Matrix.html", "classyage_1_1Matrix" ], - [ "Vector", "classyage_1_1Vector.html", "classyage_1_1Vector" ], - [ "Vector2", "classyage_1_1Vector2.html", "classyage_1_1Vector2" ], - [ "Vector3", "classyage_1_1Vector3.html", "classyage_1_1Vector3" ], - [ "Vector4", "classyage_1_1Vector4.html", "classyage_1_1Vector4" ], - [ "Vector2d", "matrix_8h.html#a23eef341099a6b2816cf0c63f8ffe898", null ], - [ "Vector2f", "matrix_8h.html#aea25e39fde2b6a8abab71cc27371d339", null ], - [ "Vector2i", "matrix_8h.html#a57e09b8310398c434e9526ea5cc456ad", null ], - [ "Vector3d", "matrix_8h.html#a12811c7f985dbbdc34e4d93a26d21763", null ], - [ "Vector3f", "matrix_8h.html#ae04792ab12e05bcb11c0316b142ebeec", null ], - [ "Vector3i", "matrix_8h.html#a747a31edd11312cbae25ebb9ab12d5cb", null ], - [ "Vector4d", "matrix_8h.html#a438e5eeb3daf58452259f7534e8818e8", null ], - [ "Vector4f", "matrix_8h.html#a1896ae5c4cfed1453dadf21a4a2a48cf", null ], - [ "Vector4i", "matrix_8h.html#a6455fea9bfa32e435fbf77e02ce12759", null ], - [ "dot", "matrix_8h.html#ac4d2f55a5c3369ec42001776a582c30a", null ], - [ "multiply", "matrix_8h.html#a277125ad9fa06a7119c59d350e129985", null ], - [ "operator*", "matrix_8h.html#ad8903f6a93ac89f16846458540717507", null ], - [ "operator*", "matrix_8h.html#a090cbd6b767b583364e9cbe78d8a8d5a", null ], - [ "operator+", "matrix_8h.html#a226cc29763f745fd175844f4263d5dae", null ], - [ "operator+", "matrix_8h.html#a6b77afaa1cd077df90b9daccbfc2cbae", null ], - [ "operator+", "matrix_8h.html#a947133b8fc764d9fc5c5d8b08821cf32", null ], - [ "operator-", "matrix_8h.html#a2187fb11298a029f2877702192717090", null ], - [ "operator-", "matrix_8h.html#a8a9db24697f649f6d19f0347330d95fe", null ], - [ "operator-", "matrix_8h.html#ad9344d41af72f29cd6f8cf1ef62ed3cc", null ], - [ "operator/", "matrix_8h.html#acca4a23afb94173695bbc1e1f2cde2b3", null ], - [ "operator<<", "matrix_8h.html#a7ed614bc9d3e8b9f3f8d32b6a7ff28eb", null ], - [ "operator==", "matrix_8h.html#a5ddd829cb1c7c4c880d0fd53326858fe", null ], - [ "transpose", "matrix_8h.html#a62de4b4b6bab23717d957c370f2e41c7", null ] -]; \ No newline at end of file diff --git a/matrix_8h_source.html b/matrix_8h_source.html index dd999738..6c2331f0 100644 --- a/matrix_8h_source.html +++ b/matrix_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    matrix.h
    @@ -550,15 +534,11 @@ $(document).ready(function(){initNavTree('matrix_8h_source.html','');});
    std::vector< Type >::iterator begin()
    Iterator support for the start.
    Definition: matrix.h:128
    Type & z
    Definition: matrix.h:356
    - - + diff --git a/matrix_8md.html b/matrix_8md.html new file mode 100644 index 00000000..e815a5da --- /dev/null +++ b/matrix_8md.html @@ -0,0 +1,99 @@ + + + + + + +YAGE: docs/matrix.md File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + +
    +
    +
    +
    docs/matrix.md File Reference
    +
    +
    +
    + + + + diff --git a/matrix_guide.html b/matrix_guide.html new file mode 100644 index 00000000..11db9ed0 --- /dev/null +++ b/matrix_guide.html @@ -0,0 +1,101 @@ + + + + + + +YAGE: Matrix Guide + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    +
    Matrix Guide
    +
    +
    +

    The matrix class is a templated class which implements a mathematical Matrix.

    +

    Usage Guide

    +

    The class can be instantiated

    +

    Example Code

    +

    Creating a Matrix and performing operations on it.

    +

    ``` c++ #include <YAGE/Math/matrix.hpp>

    +

    int main(int, char **) { yage::Matrix<2, 2, int> mat1 {{1, 2, 3, 4}}; yage::Matrix<2, 2, int> mat2 {{5, 6, 7, 8}};

    +

    int dot = yage::math::dot(mat1, mat2); return 0; } ```

    +
    + + + + diff --git a/md_README.html b/md_README.html new file mode 100644 index 00000000..1e743a0a --- /dev/null +++ b/md_README.html @@ -0,0 +1,109 @@ + + + + + + +YAGE: YAGE + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    +
    YAGE
    +
    +
    +
    +master-build +
    +

    Introduction

    +

    YAGE stands for Yet Another Game Engine. It is a game engine that is being developed for a game called Arider. It uses OpenGL and GLFW for the window creation and management and graphics. It is also going to be a general game engine for use with other games in the similar style.

    +

    The inspiration for this game engine is to learn about OpenGL and create an optimised 2D game engine with a simple API that can be used to easily create simple 2D games.

    +

    The full documentation can be seen here.

    +

    Installation and usage

    +

    To use YAGE for your own game, you should link it as a static library and include the yage.h header in your project. To link the project using cmake, the library has to be added as a subdirectory and then linked with the name yage.

    +

    Build and Testing

    +

    To compile YAGE, create a build directory from the base dirqectory. Then call cmake and point it to the directory containing. CMakeLists.txt. For example, one can use the following commands

    +

    ``` shell mkdir -p build cd build cmake .. ```

    +

    The test suite can then be run using

    +

    ``` shell cd build/tests && ctest ```

    +

    License

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om – MIT License, see file LICENSE for more details.

    +
    + + + + diff --git a/md_docs_todolist.html b/md_docs_todolist.html new file mode 100644 index 00000000..761c9301 --- /dev/null +++ b/md_docs_todolist.html @@ -0,0 +1,108 @@ + + + + + + +YAGE: Add Comments + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    +
    Add Comments
    +
    +
    +

    Reason

    +

    Currently there are no comments in the code. They should be added so that in the future the code can be edited easily and improved without having to know the exact implementation of every function.

    +

    Requirements

    +
      +
    • It should follow the doxygen API so that documentation can easily be generated.
    • +
    +

    Switch GPU API

    +

    Reason

    +

    Vulkan is much more straight forward and it should be easier to understand OpenGL from it. I also the newest API that will be used in the newest games and is supported by quite a few graphics cards.

    +

    Requirements

    +
      +
    • yage shouldn't depend on GL anymore and exclusively use Vulkan libraries.
    • +
    +

    Afterthought

    +

    In the end the library will first focus on modern OpenGL, as it is much more concise and easier to implement initially.

    +
    + + + + diff --git a/md_yage_physics_README.html b/md_yage_physics_README.html index 9911b72c..6417c87a 100644 --- a/md_yage_physics_README.html +++ b/md_yage_physics_README.html @@ -8,13 +8,6 @@ - - - - -
    +
    Physics Engine
    @@ -107,14 +87,11 @@ $(document).ready(function(){initNavTree('md_yage_physics_README.html','');});

    I have ``` a = dv / dt; v = dp / dt; ```

    I am going to use the second order runga kutta method with a = 0, b = 1, alpha = 1 / 2 and beta = 1 / 2.

    - - + diff --git a/namespacemembers.html b/namespacemembers.html index 53e2112c..07615d4c 100644 --- a/namespacemembers.html +++ b/namespacemembers.html @@ -8,13 +8,6 @@ - - - - -
    yage
  • glfwErrorCallback() -: yage +: yage
  • GRAVE_ACCENT : yage @@ -722,14 +702,11 @@ $(document).ready(function(){initNavTree('namespacemembers.html','');});
  • -
    - + diff --git a/namespacemembers_enum.html b/namespacemembers_enum.html index b499c027..c7c44b34 100644 --- a/namespacemembers_enum.html +++ b/namespacemembers_enum.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/namespacemembers_eval.html b/namespacemembers_eval.html index f508b45c..e765e995 100644 --- a/namespacemembers_eval.html +++ b/namespacemembers_eval.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/namespacemembers_func.html b/namespacemembers_func.html index 1bfe6a8f..4cc8e7d7 100644 --- a/namespacemembers_func.html +++ b/namespacemembers_func.html @@ -8,13 +8,6 @@ - - - - -
    yage::matrix
  • glfwErrorCallback() -: yage +: yage
  • init() : yage @@ -158,14 +138,11 @@ $(document).ready(function(){initNavTree('namespacemembers_func.html','');});
  • -
    - + diff --git a/namespacemembers_type.html b/namespacemembers_type.html index 17c3c330..a38ac127 100644 --- a/namespacemembers_type.html +++ b/namespacemembers_type.html @@ -8,13 +8,6 @@ - - - - -
    -
    - + diff --git a/namespaces.html b/namespaces.html index 97183373..b59c2150 100644 --- a/namespaces.html +++ b/namespaces.html @@ -8,13 +8,6 @@ - - - - -
    Here is a list of all namespaces with brief descriptions:
    [detail level 12]
    - +
    \NyageProject namespace
    \NyageCore includes
     oNdetails
     \NmatrixNamespace containing functions that operate on matrices
    -
    - + diff --git a/namespaces.js b/namespaces.js deleted file mode 100644 index 10ccff04..00000000 --- a/namespaces.js +++ /dev/null @@ -1,4 +0,0 @@ -var namespaces = -[ - [ "yage", "namespaceyage.html", "namespaceyage" ] -]; \ No newline at end of file diff --git a/namespaceyage.html b/namespaceyage.html index c7c94fb1..b71bb9c9 100644 --- a/namespaceyage.html +++ b/namespaceyage.html @@ -8,13 +8,6 @@ - - - - -
    +
    Namespaces | @@ -115,7 +95,7 @@ $(document).ready(function(){initNavTree('namespaceyage.html','');});
    -

    Project namespace. +

    Core includes. More...

    - @@ -160,6 +138,21 @@ Classes + + + + + + + + + + + + + + + @@ -241,6 +234,7 @@ Enumerations   LogLevel::FATAL
    } + - - + + - + - +

    @@ -135,8 +115,6 @@ Classes

    class  IoManager
     
    class  Logger
     

    Logger

    - More...
     
    class  LogMessage
     
     
    struct  Vertex
     
    class  Engine
     Main engine class that contains a systems, the main loop and the update function that updates all the systems. More...
     
    class  Entity
     Entity convenience class. More...
     
    class  EntityManager
     Manages entities in a space. More...
     
    class  Space
     Space that keeps track of all the entities, componenets and runs the systems on the data to update them. More...
     
    class  System
     System interface for the different systems in the engine. More...
     
    class  Matrix
     Base Matrix class used by other similar classes. More...
     
     Different log levels that can be assigned to each message sent to the Logger. More...
     
    enum  WindowFlags : unsigned { SHOWN = 0x1, HIDDEN = 0x2, @@ -446,20 +440,21 @@ Functions
    template<int M, int N, class T >
    std::ostream & operator<< (std::ostream &os, const Matrix< M, N, T > &mat)
     
    void glfwErrorCallback (int, const char *description)
     
    void glfwErrorCallback (int, const char *)
     
    void init ()
     Initializes yage. More...
     Initializes YAGE. More...
     
    void quit ()
     Quit and cleanup yage. More...
     Quit and cleanup YAGE. More...
     

    Detailed Description

    -

    Project namespace.

    -
    Todo:
    remove the include to make compilation faster
    -
    Todo:
    think of removing this, by, for example, using a pointer This could be more efficient when copying the texture out of the spritesheet.
    -

    Avoids collision as all the classes and global functions are wrapped in. it.

    +

    Core includes.

    +
    Todo:
    remove the include to make compilation faster
    +
    Todo:
    think of removing this, by, for example, using a pointer This could be more efficient when copying the texture out of the spritesheet.
    +

    Data structues useful for the game engine and games developed by it Math templated implementation of matrices and operations on them. Physics implementation however, Box2D Rendering implementations for spritebatching and default shapes. Engine that includes a Entity Component System to organize the data and make it more flexible and efficient. Project namespace.

    +

    Avoids collision as all the classes and global functions are wrapped in.

    Typedef Documentation

    @@ -859,16 +854,24 @@ Functions
    + +

    Different log levels that can be assigned to each message sent to the Logger.

    +

    The logger then outputs the message if it is above the minimum log level, or does not process it.

    Enumerator
    DEBUG  +

    Lowest log level. This is used by the game engine to output debugging information but is turned off in the logger by default.

    INFO  +

    Information message.

    WARNING  +

    Warning message.

    ERROR  +

    Error message.

    FATAL  +

    Fatal message that should be output when the game crashes.

    @@ -897,7 +900,7 @@ Functions

    Function Documentation

    - +
    @@ -936,9 +939,8 @@ Functions
    -

    Initializes yage.

    -

    This is only there to initialize glfw.

    -
    Returns
    Returns true if the initialization was successful.
    +

    Initializes YAGE.

    +

    This is there to initialize GLFW, which is the current window manager that is used with OpenGL.

    @@ -1310,21 +1312,17 @@ template<int M, int N, class T >
    -

    Quit and cleanup yage.

    -

    glfw needs to clean itself up.

    +

    Quit and cleanup YAGE.

    +

    This also cleans up GLFW after it was initialized.

    - - + diff --git a/namespaceyage.js b/namespaceyage.js deleted file mode 100644 index 3ef54125..00000000 --- a/namespaceyage.js +++ /dev/null @@ -1,40 +0,0 @@ -var namespaceyage = -[ - [ "details", "namespaceyage_1_1details.html", "namespaceyage_1_1details" ], - [ "matrix", "namespaceyage_1_1matrix.html", null ], - [ "Camera", "classyage_1_1Camera.html", "classyage_1_1Camera" ], - [ "ImageLoader", "classyage_1_1ImageLoader.html", "classyage_1_1ImageLoader" ], - [ "IoManager", "classyage_1_1IoManager.html", "classyage_1_1IoManager" ], - [ "Logger", "classyage_1_1Logger.html", "classyage_1_1Logger" ], - [ "LogMessage", "classyage_1_1LogMessage.html", "classyage_1_1LogMessage" ], - [ "LogSink", "classyage_1_1LogSink.html", "classyage_1_1LogSink" ], - [ "ResourceManager", "classyage_1_1ResourceManager.html", "classyage_1_1ResourceManager" ], - [ "SpriteSheet", "classyage_1_1SpriteSheet.html", "classyage_1_1SpriteSheet" ], - [ "TextureCache", "classyage_1_1TextureCache.html", "classyage_1_1TextureCache" ], - [ "Window", "classyage_1_1Window.html", "classyage_1_1Window" ], - [ "Texture", "structyage_1_1Texture.html", "structyage_1_1Texture" ], - [ "Position", "structyage_1_1Position.html", "structyage_1_1Position" ], - [ "Colour", "structyage_1_1Colour.html", "structyage_1_1Colour" ], - [ "UV", "structyage_1_1UV.html", "structyage_1_1UV" ], - [ "Vertex", "structyage_1_1Vertex.html", "structyage_1_1Vertex" ], - [ "Matrix", "classyage_1_1Matrix.html", "classyage_1_1Matrix" ], - [ "Vector", "classyage_1_1Vector.html", "classyage_1_1Vector" ], - [ "Vector2", "classyage_1_1Vector2.html", "classyage_1_1Vector2" ], - [ "Vector3", "classyage_1_1Vector3.html", "classyage_1_1Vector3" ], - [ "Vector4", "classyage_1_1Vector4.html", "classyage_1_1Vector4" ], - [ "Body", "classyage_1_1Body.html", "classyage_1_1Body" ], - [ "Collider", "classyage_1_1Collider.html", "classyage_1_1Collider" ], - [ "CollisionBody", "classyage_1_1CollisionBody.html", "classyage_1_1CollisionBody" ], - [ "ParticleBody", "classyage_1_1ParticleBody.html", "classyage_1_1ParticleBody" ], - [ "RectangleCollider", "classyage_1_1RectangleCollider.html", "classyage_1_1RectangleCollider" ], - [ "RigidBody", "classyage_1_1RigidBody.html", "classyage_1_1RigidBody" ], - [ "Batch", "classyage_1_1Batch.html", "classyage_1_1Batch" ], - [ "Drawable", "classyage_1_1Drawable.html", "classyage_1_1Drawable" ], - [ "Rectangle", "classyage_1_1Rectangle.html", "classyage_1_1Rectangle" ], - [ "Shader", "classyage_1_1Shader.html", "classyage_1_1Shader" ], - [ "Shape", "classyage_1_1Shape.html", "classyage_1_1Shape" ], - [ "Sprite", "classyage_1_1Sprite.html", "classyage_1_1Sprite" ], - [ "SpriteBatch", "classyage_1_1SpriteBatch.html", "classyage_1_1SpriteBatch" ], - [ "Active", "classyage_1_1Active.html", "classyage_1_1Active" ], - [ "SyncQueue", "classyage_1_1SyncQueue.html", "classyage_1_1SyncQueue" ] -]; \ No newline at end of file diff --git a/namespaceyage_1_1details.html b/namespaceyage_1_1details.html index b5b050a7..34890946 100644 --- a/namespaceyage_1_1details.html +++ b/namespaceyage_1_1details.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -144,15 +128,11 @@ Typedefs
    - - + diff --git a/namespaceyage_1_1details.js b/namespaceyage_1_1details.js deleted file mode 100644 index 84b71ea0..00000000 --- a/namespaceyage_1_1details.js +++ /dev/null @@ -1,7 +0,0 @@ -var namespaceyage_1_1details = -[ - [ "Coordinate", "structyage_1_1details_1_1Coordinate.html", "structyage_1_1details_1_1Coordinate" ], - [ "Row", "classyage_1_1details_1_1Row.html", "classyage_1_1details_1_1Row" ], - [ "RenderBatch", "structyage_1_1details_1_1RenderBatch.html", "structyage_1_1details_1_1RenderBatch" ], - [ "Glyph", "structyage_1_1details_1_1Glyph.html", "structyage_1_1details_1_1Glyph" ] -]; \ No newline at end of file diff --git a/namespaceyage_1_1matrix.html b/namespaceyage_1_1matrix.html index 5a120334..e4274683 100644 --- a/namespaceyage_1_1matrix.html +++ b/namespaceyage_1_1matrix.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -203,7 +187,7 @@ template<int M, int N, int P, int Q, class T >

    Requires the two matrices to be compatible with multiplication.

    -
    Todo:
    Think if this should be a static_assert.
    +
    Todo:
    Think if this should be a static_assert.

    Performs multiplication by getting the rows and columns, transposing one of them and then doting the result.

    @@ -235,15 +219,11 @@ template<int M, int N, class T > - - + diff --git a/nav_f.png b/nav_f.png index 72a58a52..da564a28 100644 Binary files a/nav_f.png and b/nav_f.png differ diff --git a/nav_h.png b/nav_h.png index 33389b10..43bfa63f 100644 Binary files a/nav_h.png and b/nav_h.png differ diff --git a/navtree.css b/navtree.css deleted file mode 100644 index 41a9cb96..00000000 --- a/navtree.css +++ /dev/null @@ -1,143 +0,0 @@ -#nav-tree .children_ul { - margin:0; - padding:4px; -} - -#nav-tree ul { - list-style:none outside none; - margin:0px; - padding:0px; -} - -#nav-tree li { - white-space:nowrap; - margin:0px; - padding:0px; -} - -#nav-tree .plus { - margin:0px; -} - -#nav-tree .selected { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} - -#nav-tree img { - margin:0px; - padding:0px; - border:0px; - vertical-align: middle; -} - -#nav-tree a { - text-decoration:none; - padding:0px; - margin:0px; - outline:none; -} - -#nav-tree .label { - margin:0px; - padding:0px; - font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -#nav-tree .label a { - padding:2px; -} - -#nav-tree .selected a { - text-decoration:none; - color:#fff; -} - -#nav-tree .children_ul { - margin:0px; - padding:0px; -} - -#nav-tree .item { - margin:0px; - padding:0px; -} - -#nav-tree { - padding: 0px 0px; - background-color: #FAFAFF; - font-size:14px; - overflow:auto; -} - -#doc-content { - overflow:auto; - display:block; - padding:0px; - margin:0px; - -webkit-overflow-scrolling : touch; /* iOS 5+ */ -} - -#side-nav { - padding:0 6px 0 0; - margin: 0px; - display:block; - position: absolute; - left: 0px; - width: 250px; -} - -.ui-resizable .ui-resizable-handle { - display:block; -} - -.ui-resizable-e { - background:url("ftv2splitbar.png") repeat scroll right center transparent; - cursor:e-resize; - height:100%; - right:0; - top:0; - width:6px; -} - -.ui-resizable-handle { - display:none; - font-size:0.1px; - position:absolute; - z-index:1; -} - -#nav-tree-contents { - margin: 6px 0px 0px 0px; -} - -#nav-tree { - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - -webkit-overflow-scrolling : touch; /* iOS 5+ */ -} - -#nav-sync { - position:absolute; - top:5px; - right:24px; - z-index:0; -} - -#nav-sync img { - opacity:0.3; -} - -#nav-sync img:hover { - opacity:0.9; -} - -@media print -{ - #nav-tree { display: none; } - div.ui-resizable-handle { display: none; position: relative; } -} - diff --git a/navtree.js b/navtree.js deleted file mode 100644 index ef75b377..00000000 --- a/navtree.js +++ /dev/null @@ -1,567 +0,0 @@ -var NAVTREE = -[ - [ "YAGE", "index.html", [ - [ "Physics Engine", "md_yage_physics_README.html", null ], - [ "Todo List", "todo.html", null ], - [ "Deprecated List", "deprecated.html", null ], - [ "Bug List", "bug.html", null ], - [ "Namespaces", null, [ - [ "Namespace List", "namespaces.html", "namespaces" ], - [ "Namespace Members", "namespacemembers.html", [ - [ "All", "namespacemembers.html", null ], - [ "Functions", "namespacemembers_func.html", null ], - [ "Typedefs", "namespacemembers_type.html", null ], - [ "Enumerations", "namespacemembers_enum.html", null ], - [ "Enumerator", "namespacemembers_eval.html", null ] - ] ] - ] ], - [ "Classes", null, [ - [ "Class List", "annotated.html", "annotated" ], - [ "Class Index", "classes.html", null ], - [ "Class Hierarchy", "hierarchy.html", "hierarchy" ], - [ "Class Members", "functions.html", [ - [ "All", "functions.html", "functions_dup" ], - [ "Functions", "functions_func.html", null ], - [ "Variables", "functions_vars.html", null ], - [ "Typedefs", "functions_type.html", null ], - [ "Related Functions", "functions_rela.html", null ] - ] ] - ] ], - [ "Files", null, [ - [ "File List", "files.html", "files" ], - [ "File Members", "globals.html", [ - [ "All", "globals.html", null ], - [ "Functions", "globals_func.html", null ], - [ "Variables", "globals_vars.html", null ], - [ "Typedefs", "globals_type.html", null ], - [ "Enumerator", "globals_eval.html", null ], - [ "Macros", "globals_defs.html", null ] - ] ] - ] ] - ] ] -]; - -var NAVTREEINDEX = -[ -"active_8cpp.html", -"functions_g.html", -"shader_8h_source.html" -]; - -var SYNCONMSG = 'click to disable panel synchronisation'; -var SYNCOFFMSG = 'click to enable panel synchronisation'; -var SYNCONMSG = 'click to disable panel synchronisation'; -var SYNCOFFMSG = 'click to enable panel synchronisation'; -var navTreeSubIndices = new Array(); - -function getData(varName) -{ - var i = varName.lastIndexOf('/'); - var n = i>=0 ? varName.substring(i+1) : varName; - return eval(n.replace(/\-/g,'_')); -} - -function stripPath(uri) -{ - return uri.substring(uri.lastIndexOf('/')+1); -} - -function stripPath2(uri) -{ - var i = uri.lastIndexOf('/'); - var s = uri.substring(i+1); - var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); - return m ? uri.substring(i-6) : s; -} - -function localStorageSupported() -{ - try { - return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; - } - catch(e) { - return false; - } -} - - -function storeLink(link) -{ - if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { - window.localStorage.setItem('navpath',link); - } -} - -function deleteLink() -{ - if (localStorageSupported()) { - window.localStorage.setItem('navpath',''); - } -} - -function cachedLink() -{ - if (localStorageSupported()) { - return window.localStorage.getItem('navpath'); - } else { - return ''; - } -} - -function getScript(scriptName,func,show) -{ - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement('script'); - script.id = scriptName; - script.type = 'text/javascript'; - script.onload = func; - script.src = scriptName+'.js'; - if ($.browser.msie && $.browser.version<=8) { - // script.onload does not work with older versions of IE - script.onreadystatechange = function() { - if (script.readyState=='complete' || script.readyState=='loaded') { - func(); if (show) showRoot(); - } - } - } - head.appendChild(script); -} - -function createIndent(o,domNode,node,level) -{ - var level=-1; - var n = node; - while (n.parentNode) { level++; n=n.parentNode; } - if (node.childrenData) { - var imgNode = document.createElement("img"); - imgNode.style.paddingLeft=(16*level).toString()+'px'; - imgNode.width = 16; - imgNode.height = 22; - imgNode.border = 0; - node.plus_img = imgNode; - node.expandToggle = document.createElement("a"); - node.expandToggle.href = "javascript:void(0)"; - node.expandToggle.onclick = function() { - if (node.expanded) { - $(node.getChildrenUL()).slideUp("fast"); - node.plus_img.src = node.relpath+"ftv2pnode.png"; - node.expanded = false; - } else { - expandNode(o, node, false, false); - } - } - node.expandToggle.appendChild(imgNode); - domNode.appendChild(node.expandToggle); - imgNode.src = node.relpath+"ftv2pnode.png"; - } else { - var span = document.createElement("span"); - span.style.display = 'inline-block'; - span.style.width = 16*(level+1)+'px'; - span.style.height = '22px'; - span.innerHTML = ' '; - domNode.appendChild(span); - } -} - -var animationInProgress = false; - -function gotoAnchor(anchor,aname,updateLocation) -{ - var pos, docContent = $('#doc-content'); - if (anchor.parent().attr('class')=='memItemLeft' || - anchor.parent().attr('class')=='fieldtype' || - anchor.parent().is(':header')) - { - pos = anchor.parent().position().top; - } else if (anchor.position()) { - pos = anchor.position().top; - } - if (pos) { - var dist = Math.abs(Math.min( - pos-docContent.offset().top, - docContent[0].scrollHeight- - docContent.height()-docContent.scrollTop())); - animationInProgress=true; - docContent.animate({ - scrollTop: pos + docContent.scrollTop() - docContent.offset().top - },Math.max(50,Math.min(500,dist)),function(){ - if (updateLocation) window.location.href=aname; - animationInProgress=false; - }); - } -} - -function newNode(o, po, text, link, childrenData, lastNode) -{ - var node = new Object(); - node.children = Array(); - node.childrenData = childrenData; - node.depth = po.depth + 1; - node.relpath = po.relpath; - node.isLast = lastNode; - - node.li = document.createElement("li"); - po.getChildrenUL().appendChild(node.li); - node.parentNode = po; - - node.itemDiv = document.createElement("div"); - node.itemDiv.className = "item"; - - node.labelSpan = document.createElement("span"); - node.labelSpan.className = "label"; - - createIndent(o,node.itemDiv,node,0); - node.itemDiv.appendChild(node.labelSpan); - node.li.appendChild(node.itemDiv); - - var a = document.createElement("a"); - node.labelSpan.appendChild(a); - node.label = document.createTextNode(text); - node.expanded = false; - a.appendChild(node.label); - if (link) { - var url; - if (link.substring(0,1)=='^') { - url = link.substring(1); - link = url; - } else { - url = node.relpath+link; - } - a.className = stripPath(link.replace('#',':')); - if (link.indexOf('#')!=-1) { - var aname = '#'+link.split('#')[1]; - var srcPage = stripPath($(location).attr('pathname')); - var targetPage = stripPath(link.split('#')[0]); - a.href = srcPage!=targetPage ? url : "javascript:void(0)"; - a.onclick = function(){ - storeLink(link); - if (!$(a).parent().parent().hasClass('selected')) - { - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - $(a).parent().parent().addClass('selected'); - $(a).parent().parent().attr('id','selected'); - } - var anchor = $(aname); - gotoAnchor(anchor,aname,true); - }; - } else { - a.href = url; - a.onclick = function() { storeLink(link); } - } - } else { - if (childrenData != null) - { - a.className = "nolink"; - a.href = "javascript:void(0)"; - a.onclick = node.expandToggle.onclick; - } - } - - node.childrenUL = null; - node.getChildrenUL = function() { - if (!node.childrenUL) { - node.childrenUL = document.createElement("ul"); - node.childrenUL.className = "children_ul"; - node.childrenUL.style.display = "none"; - node.li.appendChild(node.childrenUL); - } - return node.childrenUL; - }; - - return node; -} - -function showRoot() -{ - var headerHeight = $("#top").height(); - var footerHeight = $("#nav-path").height(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - (function (){ // retry until we can scroll to the selected item - try { - var navtree=$('#nav-tree'); - navtree.scrollTo('#selected',0,{offset:-windowHeight/2}); - } catch (err) { - setTimeout(arguments.callee, 0); - } - })(); -} - -function expandNode(o, node, imm, showRoot) -{ - if (node.childrenData && !node.expanded) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - expandNode(o, node, imm, showRoot); - }, showRoot); - } else { - if (!node.childrenVisited) { - getNode(o, node); - } if (imm || ($.browser.msie && $.browser.version>8)) { - // somehow slideDown jumps to the start of tree for IE9 :-( - $(node.getChildrenUL()).show(); - } else { - $(node.getChildrenUL()).slideDown("fast"); - } - if (node.isLast) { - node.plus_img.src = node.relpath+"ftv2mlastnode.png"; - } else { - node.plus_img.src = node.relpath+"ftv2mnode.png"; - } - node.expanded = true; - } - } -} - -function glowEffect(n,duration) -{ - n.addClass('glow').delay(duration).queue(function(next){ - $(this).removeClass('glow');next(); - }); -} - -function highlightAnchor() -{ - var aname = $(location).attr('hash'); - var anchor = $(aname); - if (anchor.parent().attr('class')=='memItemLeft'){ - var rows = $('.memberdecls tr[class$="'+ - window.location.hash.substring(1)+'"]'); - glowEffect(rows.children(),300); // member without details - } else if (anchor.parents().slice(2).prop('tagName')=='TR') { - glowEffect(anchor.parents('div.memitem'),1000); // enum value - } else if (anchor.parent().attr('class')=='fieldtype'){ - glowEffect(anchor.parent().parent(),1000); // struct field - } else if (anchor.parent().is(":header")) { - glowEffect(anchor.parent(),1000); // section header - } else { - glowEffect(anchor.next(),1000); // normal member - } - gotoAnchor(anchor,aname,false); -} - -function selectAndHighlight(hash,n) -{ - var a; - if (hash) { - var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1); - a=$('.item a[class$="'+link+'"]'); - } - if (a && a.length) { - a.parent().parent().addClass('selected'); - a.parent().parent().attr('id','selected'); - highlightAnchor(); - } else if (n) { - $(n.itemDiv).addClass('selected'); - $(n.itemDiv).attr('id','selected'); - } - if ($('#nav-tree-contents .item:first').hasClass('selected')) { - $('#nav-sync').css('top','30px'); - } else { - $('#nav-sync').css('top','5px'); - } - showRoot(); -} - -function showNode(o, node, index, hash) -{ - if (node && node.childrenData) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - showNode(o,node,index,hash); - },true); - } else { - if (!node.childrenVisited) { - getNode(o, node); - } - $(node.getChildrenUL()).css({'display':'block'}); - if (node.isLast) { - node.plus_img.src = node.relpath+"ftv2mlastnode.png"; - } else { - node.plus_img.src = node.relpath+"ftv2mnode.png"; - } - node.expanded = true; - var n = node.children[o.breadcrumbs[index]]; - if (index+11) hash = '#'+parts[1]; - else hash=''; - } - if (hash.match(/^#l\d+$/)) { - var anchor=$('a[name='+hash.substring(1)+']'); - glowEffect(anchor.parent(),1000); // line number - hash=''; // strip line number anchors - //root=root.replace(/_source\./,'.'); // source link to doc link - } - var url=root+hash; - var i=-1; - while (NAVTREEINDEX[i+1]<=url) i++; - if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath) - } else { - getScript(relpath+'navtreeindex'+i,function(){ - navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath); - } - },true); - } -} - -function showSyncOff(n,relpath) -{ - n.html(''); -} - -function showSyncOn(n,relpath) -{ - n.html(''); -} - -function toggleSyncButton(relpath) -{ - var navSync = $('#nav-sync'); - if (navSync.hasClass('sync')) { - navSync.removeClass('sync'); - showSyncOff(navSync,relpath); - storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash')); - } else { - navSync.addClass('sync'); - showSyncOn(navSync,relpath); - deleteLink(); - } -} - -function initNavTree(toroot,relpath) -{ - var o = new Object(); - o.toroot = toroot; - o.node = new Object(); - o.node.li = document.getElementById("nav-tree-contents"); - o.node.childrenData = NAVTREE; - o.node.children = new Array(); - o.node.childrenUL = document.createElement("ul"); - o.node.getChildrenUL = function() { return o.node.childrenUL; }; - o.node.li.appendChild(o.node.childrenUL); - o.node.depth = 0; - o.node.relpath = relpath; - o.node.expanded = false; - o.node.isLast = true; - o.node.plus_img = document.createElement("img"); - o.node.plus_img.src = relpath+"ftv2pnode.png"; - o.node.plus_img.width = 16; - o.node.plus_img.height = 22; - - if (localStorageSupported()) { - var navSync = $('#nav-sync'); - if (cachedLink()) { - showSyncOff(navSync,relpath); - navSync.removeClass('sync'); - } else { - showSyncOn(navSync,relpath); - } - navSync.click(function(){ toggleSyncButton(relpath); }); - } - - $(window).load(function(){ - navTo(o,toroot,window.location.hash,relpath); - showRoot(); - }); - - $(window).bind('hashchange', function(){ - if (window.location.hash && window.location.hash.length>1){ - var a; - if ($(location).attr('hash')){ - var clslink=stripPath($(location).attr('pathname'))+':'+ - $(location).attr('hash').substring(1); - a=$('.item a[class$="'+clslink+'"]'); - } - if (a==null || !$(a).parent().parent().hasClass('selected')){ - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - } - var link=stripPath2($(location).attr('pathname')); - navTo(o,link,$(location).attr('hash'),relpath); - } else if (!animationInProgress) { - $('#doc-content').scrollTop(0); - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - navTo(o,toroot,window.location.hash,relpath); - } - }) -} - diff --git a/navtreeindex0.js b/navtreeindex0.js deleted file mode 100644 index 562333a0..00000000 --- a/navtreeindex0.js +++ /dev/null @@ -1,253 +0,0 @@ -var NAVTREEINDEX0 = -{ -"active_8cpp.html":[6,0,0,5,0], -"active_8h.html":[6,0,0,5,1], -"active_8h_source.html":[6,0,0,5,1], -"annotated.html":[5,0], -"batch_8h.html":[6,0,0,4,0], -"batch_8h_source.html":[6,0,0,4,0], -"body_8cpp.html":[6,0,0,3,0], -"body_8h.html":[6,0,0,3,1], -"body_8h_source.html":[6,0,0,3,1], -"bug.html":[3], -"camera_8cpp.html":[6,0,0,0,0], -"camera_8h.html":[6,0,0,0,1], -"camera_8h_source.html":[6,0,0,0,1], -"classes.html":[5,1], -"classyage_1_1Active.html":[5,0,0,35], -"classyage_1_1Active.html#a4b82fec6f02c00d186b1b840ce8f11dc":[5,0,0,35,0], -"classyage_1_1Active.html#a665673b94eb5ce7c448839e5bb6e0326":[5,0,0,35,5], -"classyage_1_1Active.html#a7cd7344f0b8b7aa93ac0449e2fbbf7bd":[5,0,0,35,1], -"classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064":[5,0,0,35,3], -"classyage_1_1Active.html#ab69d08cf4804b59ac9db283015e749f2":[5,0,0,35,2], -"classyage_1_1Active.html#add837044e73e4bc9849f09495535600c":[5,0,0,35,4], -"classyage_1_1Batch.html":[5,0,0,28], -"classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477":[5,0,0,28,2], -"classyage_1_1Batch.html#a322b0fe531c9cfa506d6d2dd786a236e":[5,0,0,28,1], -"classyage_1_1Batch.html#a3439c8dd88d87be4460161d233044c65":[5,0,0,28,3], -"classyage_1_1Batch.html#ab458f3129d2a329806dd00c6be77709d":[5,0,0,28,0], -"classyage_1_1Body.html":[5,0,0,22], -"classyage_1_1Body.html#a01b2a500e71bc88f2cb597f376bc8289":[5,0,0,22,9], -"classyage_1_1Body.html#a1023ebd31914571f137fb5aadc88c364":[5,0,0,22,4], -"classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36":[5,0,0,22,2], -"classyage_1_1Body.html#a262c896b473d7672cde524145cd7981d":[5,0,0,22,6], -"classyage_1_1Body.html#a36c0a4485bf9a704901d88c6cf212a5f":[5,0,0,22,5], -"classyage_1_1Body.html#a454a7c59d07c94afb0a35c3d53ec2191":[5,0,0,22,8], -"classyage_1_1Body.html#a4f61913cf00244a6160e09cda846f766":[5,0,0,22,7], -"classyage_1_1Body.html#a56310be4f9d7d2d4e7f954af0e0a5878":[5,0,0,22,1], -"classyage_1_1Body.html#a8a800cef0fb3561332d4a97c790e7225":[5,0,0,22,3], -"classyage_1_1Body.html#a8fe4f244be47f1336a57c1f2aa095157":[5,0,0,22,10], -"classyage_1_1Body.html#aeca769807d9b6f6fb3c9f61deaa83b86":[5,0,0,22,0], -"classyage_1_1Body.html#afead7edec899748eab78879e6e6c5741":[5,0,0,22,11], -"classyage_1_1Camera.html":[5,0,0,2], -"classyage_1_1Camera.html#a012820185cceb451926bc4ef1607b324":[5,0,0,2,1], -"classyage_1_1Camera.html#a13be1e50638977d62cff9ffba1213611":[5,0,0,2,0], -"classyage_1_1Camera.html#a8b50af04dae6eca905c5008ef93b72d0":[5,0,0,2,3], -"classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c":[5,0,0,2,2], -"classyage_1_1Collider.html":[5,0,0,23], -"classyage_1_1Collider.html#a2ae348a82a0ca7a871c05f36e5031161":[5,0,0,23,3], -"classyage_1_1Collider.html#a4a8ad9e664a0015e023a70d196302fe9":[5,0,0,23,2], -"classyage_1_1Collider.html#abbab9373c0805ffa5215c08b82eaed03":[5,0,0,23,1], -"classyage_1_1Collider.html#ad7456f84c1acb4fd9ee0ea67c8ee7308":[5,0,0,23,4], -"classyage_1_1Collider.html#ae33aeb0711409e7c3ef9e21ed99fa8a3":[5,0,0,23,0], -"classyage_1_1CollisionBody.html":[5,0,0,24], -"classyage_1_1CollisionBody.html#a5289e613269facc45cd451872c17a83d":[5,0,0,24,0], -"classyage_1_1CollisionBody.html#a758b2f867f276f4c7e02ebda2cd04c8b":[5,0,0,24,1], -"classyage_1_1Drawable.html":[5,0,0,29], -"classyage_1_1Drawable.html#abee95e68b5bffef86a35dafca296c45e":[5,0,0,29,0], -"classyage_1_1ImageLoader.html":[5,0,0,3], -"classyage_1_1ImageLoader.html#ad8dcdaaed43713f07723f2b6719d1b32":[5,0,0,3,0], -"classyage_1_1IoManager.html":[5,0,0,4], -"classyage_1_1IoManager.html#a75d13ca634df592e44e4152fedcd446d":[5,0,0,4,0], -"classyage_1_1LogMessage.html":[5,0,0,6], -"classyage_1_1LogMessage.html#a31eb7ca394acbcfedca104e709f1c4ae":[5,0,0,6,5], -"classyage_1_1LogMessage.html#a855e0e72055f785def530feaf27cbeab":[5,0,0,6,4], -"classyage_1_1LogMessage.html#aed38ed794cdc0b3d7776f424570e92da":[5,0,0,6,6], -"classyage_1_1LogMessage.html#af4ab2630201ecd155c329fbfebe352be":[5,0,0,6,2], -"classyage_1_1LogMessage.html#af79ecd529e839a5a3e99077dde60df90":[5,0,0,6,3], -"classyage_1_1LogMessage.html#af82ed7ceef5cfdac54ad2e176deb9fca":[5,0,0,6,1], -"classyage_1_1LogMessage.html#aff02b76416d2846736b7ecd798921a0a":[5,0,0,6,7], -"classyage_1_1LogSink.html":[5,0,0,7], -"classyage_1_1LogSink.html#a1ba5b4000f07f581e0d0c2babb2811dc":[5,0,0,7,3], -"classyage_1_1LogSink.html#a43a7bf025e46197b541f186e16209356":[5,0,0,7,4], -"classyage_1_1LogSink.html#a8583ac57ebff98ab38c613c03b5bfbba":[5,0,0,7,1], -"classyage_1_1LogSink.html#aadebaf552b839879189965faf7b504cf":[5,0,0,7,2], -"classyage_1_1LogSink.html#ab7b70959364771b105c0dffa0b64c38e":[5,0,0,7,0], -"classyage_1_1LogSink.html#abe2e73398ecb925233b50be5d15e20f9":[5,0,0,7,5], -"classyage_1_1LogSink.html#ac41716cf03dac6311cb7287c9edf8a8d":[5,0,0,7,6], -"classyage_1_1Logger.html":[5,0,0,5], -"classyage_1_1Logger.html#a036fcbfcb9d3428931ec5a11237501a8":[5,0,0,5,5], -"classyage_1_1Logger.html#a2ce5eb7eb1b108e38c1b90655999a8eb":[5,0,0,5,10], -"classyage_1_1Logger.html#a3c7d6d1a9ccf0397dc81350cef6782f2":[5,0,0,5,8], -"classyage_1_1Logger.html#a3d54590303257e9a8d1da26d59571352":[5,0,0,5,1], -"classyage_1_1Logger.html#a5ec9a752e8cbb278342fdb49520fbcdd":[5,0,0,5,4], -"classyage_1_1Logger.html#a71f6ab0fa1e86d790553c0763a255b2b":[5,0,0,5,2], -"classyage_1_1Logger.html#a950c0c75b86bf330cf11a0ad29bd9a64":[5,0,0,5,0], -"classyage_1_1Logger.html#aac48688c66402e9bc63c4871641ab245":[5,0,0,5,9], -"classyage_1_1Logger.html#acbd21a2da8b423e9f606c386cabac074":[5,0,0,5,3], -"classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e":[5,0,0,5,7], -"classyage_1_1Logger.html#afe5dc1d30d3fd2599a119455672d6e00":[5,0,0,5,6], -"classyage_1_1Matrix.html":[5,0,0,17], -"classyage_1_1Matrix.html#a07678d7007e89487c7168df84f2a4fa8":[5,0,0,17,12], -"classyage_1_1Matrix.html#a0ab11922319366f6e74f6e9e7d7abeed":[5,0,0,17,14], -"classyage_1_1Matrix.html#a0cc8e242b2e8319789aae0e1d81834a1":[5,0,0,17,11], -"classyage_1_1Matrix.html#a0e989030df9ebc7e3885a7bc811a45c6":[5,0,0,17,10], -"classyage_1_1Matrix.html#a191b02ff353d04f18779d4c84e20927b":[5,0,0,17,1], -"classyage_1_1Matrix.html#a20ea5fe16d27ef15f775b5497cadc851":[5,0,0,17,4], -"classyage_1_1Matrix.html#a2148cd52008892765ad90250c68afba1":[5,0,0,17,3], -"classyage_1_1Matrix.html#a73b7d1f94f4f72a2294b71b3a35794ad":[5,0,0,17,0], -"classyage_1_1Matrix.html#a74475218328d6ef69701a6e261df925b":[5,0,0,17,5], -"classyage_1_1Matrix.html#a83d77d3a40ced5e2b703a6d66b6e6055":[5,0,0,17,2], -"classyage_1_1Matrix.html#a89e826d2c6646002cfae23dde7f61145":[5,0,0,17,9], -"classyage_1_1Matrix.html#a8b7e0913efdb5e8c9ff39df4c4f36228":[5,0,0,17,7], -"classyage_1_1Matrix.html#a960273d1ac46a8edb71ceee08ee639b8":[5,0,0,17,6], -"classyage_1_1Matrix.html#a9e9cbf0fd7c768696ef909bdac1a706d":[5,0,0,17,13], -"classyage_1_1Matrix.html#acc2d0763f060c923ce53b37143d0a7bb":[5,0,0,17,8], -"classyage_1_1ParticleBody.html":[5,0,0,25], -"classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c":[5,0,0,25,2], -"classyage_1_1ParticleBody.html#a4d6c52fc2106ebd3f131d2be1fa3f11b":[5,0,0,25,1], -"classyage_1_1ParticleBody.html#ae20aad802b5620597d0521663061efc0":[5,0,0,25,0], -"classyage_1_1Rectangle.html":[5,0,0,30], -"classyage_1_1Rectangle.html#a45a3203b887ffcdb6a0bc7f5a4de717e":[5,0,0,30,0], -"classyage_1_1Rectangle.html#af9ff615160254c8289e502fac8124891":[5,0,0,30,1], -"classyage_1_1RectangleCollider.html":[5,0,0,26], -"classyage_1_1RectangleCollider.html#a81e825cf009a437bc0f61b846cac66f6":[5,0,0,26,1], -"classyage_1_1RectangleCollider.html#ac8d8e6bdb12c21be12f7d398242147c4":[5,0,0,26,2], -"classyage_1_1RectangleCollider.html#af9e0964655073b0a190c9d06b449a969":[5,0,0,26,0], -"classyage_1_1ResourceManager.html":[5,0,0,8], -"classyage_1_1ResourceManager.html#aec533f266d9b432050faed301f4191dc":[5,0,0,8,0], -"classyage_1_1RigidBody.html":[5,0,0,27], -"classyage_1_1RigidBody.html#aed946934f970694c6f6840b09600a606":[5,0,0,27,0], -"classyage_1_1Shader.html":[5,0,0,31], -"classyage_1_1Shader.html#a1a006dcb52a4fb9f1dc61df68d3676f5":[5,0,0,31,1], -"classyage_1_1Shader.html#a1a637a37d3e72fe1cd53602e80ab23ab":[5,0,0,31,7], -"classyage_1_1Shader.html#a34fe30eb6e6d595c1996e8ea6fb3961a":[5,0,0,31,0], -"classyage_1_1Shader.html#a5d966c327ae0749ca5758880b684103a":[5,0,0,31,4], -"classyage_1_1Shader.html#a8cd66c177f148ac0b619766188696e6c":[5,0,0,31,9], -"classyage_1_1Shader.html#a9307c4f3cfaf5e584b70601294e09bdd":[5,0,0,31,3], -"classyage_1_1Shader.html#a96c50a15f45d064f43d1f01e84105e78":[5,0,0,31,8], -"classyage_1_1Shader.html#ac9bff8500e2adfa1745c843bc612f215":[5,0,0,31,6], -"classyage_1_1Shader.html#adf6dc3a526921d62b55a552f38958dd2":[5,0,0,31,2], -"classyage_1_1Shader.html#af94e7c75abb18015ade6126465a5fe05":[5,0,0,31,5], -"classyage_1_1Shape.html":[5,0,0,32], -"classyage_1_1Shape.html#ab83fd121fe04debf98b42f29c919b539":[5,0,0,32,0], -"classyage_1_1Sprite.html":[5,0,0,33], -"classyage_1_1Sprite.html#a113bfddfa62846a1d8391d1b86de7987":[5,0,0,33,0], -"classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1":[5,0,0,33,5], -"classyage_1_1Sprite.html#a33789b3e37bfcb84ed89ec69f47817a1":[5,0,0,33,2], -"classyage_1_1Sprite.html#a3fe5615022d2b157b9e6375197254897":[5,0,0,33,7], -"classyage_1_1Sprite.html#a8eed26f4fa57b3ad47d791564233ee40":[5,0,0,33,4], -"classyage_1_1Sprite.html#a97dd80e05efb9399ee8471ff40a77bee":[5,0,0,33,6], -"classyage_1_1Sprite.html#aa2f833e040940616fa17ee8f02f8cab2":[5,0,0,33,3], -"classyage_1_1Sprite.html#aa5a7958e17f1d042226b91fb1829642e":[5,0,0,33,1], -"classyage_1_1SpriteBatch.html":[5,0,0,34], -"classyage_1_1SpriteBatch.html#a195c4aca60815d413c65dce99389282d":[5,0,0,34,9], -"classyage_1_1SpriteBatch.html#a1b365d89c096d7fa138e1c7091f1d737":[5,0,0,34,7], -"classyage_1_1SpriteBatch.html#a204782dd15c82376555ad0b049c4167f":[5,0,0,34,8], -"classyage_1_1SpriteBatch.html#a30a46a7182235a739916d540781af652":[5,0,0,34,1], -"classyage_1_1SpriteBatch.html#a6e01d11880a841b153e950aa8307b1a5":[5,0,0,34,10], -"classyage_1_1SpriteBatch.html#a7f18a506f4188acd2219da8147dc0e1e":[5,0,0,34,2], -"classyage_1_1SpriteBatch.html#acf88f98ccc7ce8effd2acfded27b6af0":[5,0,0,34,5], -"classyage_1_1SpriteBatch.html#af6293aac69e1124199297e5b921a4872":[5,0,0,34,4], -"classyage_1_1SpriteBatch.html#af8b705cdad7ceefa902f3be620ac8632":[5,0,0,34,6], -"classyage_1_1SpriteBatch.html#afa26d86730be23aa5e0c8c4a9d67001a":[5,0,0,34,3], -"classyage_1_1SpriteBatch.html#afda50a8a2a6c9ffd1b9d962fae223f8a":[5,0,0,34,0], -"classyage_1_1SpriteSheet.html":[5,0,0,9], -"classyage_1_1SpriteSheet.html#a2734c2e7b8bdfc9090d240c070ee55c0":[5,0,0,9,2], -"classyage_1_1SpriteSheet.html#a50a04ebc989dbc63b0aa6d873da5ccd9":[5,0,0,9,1], -"classyage_1_1SpriteSheet.html#a73db999ab17c4846f036eb47470176f6":[5,0,0,9,0], -"classyage_1_1SyncQueue.html":[5,0,0,36], -"classyage_1_1SyncQueue.html#a0c8aa1c22e3e6d5094dbdeb88cff426b":[5,0,0,36,0], -"classyage_1_1SyncQueue.html#a1f7f099e1347b82c1f2b72a5352ca05e":[5,0,0,36,3], -"classyage_1_1SyncQueue.html#a43e4ba65c8e367ed55da9b8e3e1567b6":[5,0,0,36,2], -"classyage_1_1SyncQueue.html#a4c01a855e97a46449a97c76634ef7678":[5,0,0,36,6], -"classyage_1_1SyncQueue.html#a4ef8940b49b9c1b7a213fd38847370b1":[5,0,0,36,5], -"classyage_1_1SyncQueue.html#a8f42b9b34c6495680aade2563cc2359c":[5,0,0,36,1], -"classyage_1_1SyncQueue.html#ab8a3c646e1d2f9adfcbcfbaa2e2a4b27":[5,0,0,36,4], -"classyage_1_1TextureCache.html":[5,0,0,10], -"classyage_1_1TextureCache.html#a5f6af0bd513dd393061b2d9d18362692":[5,0,0,10,0], -"classyage_1_1TextureCache.html#abb785ce35eb847c02de67dc9e6e06bcd":[5,0,0,10,2], -"classyage_1_1TextureCache.html#ad4929640230f9a74fcd634416fe0974f":[5,0,0,10,1], -"classyage_1_1Vector.html":[5,0,0,18], -"classyage_1_1Vector.html#a54c22538916cfb3b838724b8f8662c35":[5,0,0,18,4], -"classyage_1_1Vector.html#a55fd6c60a95832ad4b68083071f9866f":[5,0,0,18,1], -"classyage_1_1Vector.html#a81efa1cb9d4ce8bb8c5cf9652a5650a2":[5,0,0,18,3], -"classyage_1_1Vector.html#a956f7b6d02c0309adece311f59c8beae":[5,0,0,18,5], -"classyage_1_1Vector.html#aa291a8ee264f81165b529b7f3a0c265d":[5,0,0,18,2], -"classyage_1_1Vector.html#ac9b202913c03bde201e350e855fbbffa":[5,0,0,18,0], -"classyage_1_1Vector2.html":[5,0,0,19], -"classyage_1_1Vector2.html#a14a436185842f7375d02b57a37832740":[5,0,0,19,5], -"classyage_1_1Vector2.html#a216ac57d39572b46ab8307a7728e4456":[5,0,0,19,7], -"classyage_1_1Vector2.html#a3ef3bc2954f387f1db2165a884765ad0":[5,0,0,19,2], -"classyage_1_1Vector2.html#a50c108903be424de1c41ce31fddd23ea":[5,0,0,19,0], -"classyage_1_1Vector2.html#a554645b415a76af47698985b7757f0c2":[5,0,0,19,6], -"classyage_1_1Vector2.html#a5a777413b63e68dc5f797d31e3d7beaf":[5,0,0,19,4], -"classyage_1_1Vector2.html#aacee766d18741a925a47b91fa0080822":[5,0,0,19,3], -"classyage_1_1Vector2.html#af69d534302a406bac419589e0a2f2917":[5,0,0,19,1], -"classyage_1_1Vector3.html":[5,0,0,20], -"classyage_1_1Vector3.html#a163c42efd0a4f365abb612c031859820":[5,0,0,20,8], -"classyage_1_1Vector3.html#a3076edb39227c1fcc77a8160fb9c5832":[5,0,0,20,7], -"classyage_1_1Vector3.html#a36744e7ef6c50b117e4105f1752c93c0":[5,0,0,20,2], -"classyage_1_1Vector3.html#a745b76ba3e49f5c73f53cb065ddf337b":[5,0,0,20,0], -"classyage_1_1Vector3.html#a9b984c33ac0a7d7ade6963baea0e5ee8":[5,0,0,20,4], -"classyage_1_1Vector3.html#aca2fa665275db5e0b842f64106b0c797":[5,0,0,20,6], -"classyage_1_1Vector3.html#ad30c9989f25ef241c59a6c59661daf3a":[5,0,0,20,1], -"classyage_1_1Vector3.html#ad8efd76556fe2ff568f81ce1d4dd1888":[5,0,0,20,5], -"classyage_1_1Vector3.html#ae91b009b2e5e81163ebf80bf5bcbe7f0":[5,0,0,20,3], -"classyage_1_1Vector4.html":[5,0,0,21], -"classyage_1_1Vector4.html#a0c7bf86ba48c9bda10e0605441bb8c3c":[5,0,0,21,5], -"classyage_1_1Vector4.html#a111ecbf09543e8fafaf3aedef77d168d":[5,0,0,21,3], -"classyage_1_1Vector4.html#a36537a95ca1764334fe9b9b1f001206d":[5,0,0,21,2], -"classyage_1_1Vector4.html#a4936ef80cc2726f6b20f525977339a13":[5,0,0,21,8], -"classyage_1_1Vector4.html#aad3540315f15d69a84aa4573d3e1c583":[5,0,0,21,6], -"classyage_1_1Vector4.html#ab6e8f6e88c13d3bbfa1a6591d97b7d03":[5,0,0,21,0], -"classyage_1_1Vector4.html#ac1b2968c7a6a6e9f2c74507760b73cdc":[5,0,0,21,10], -"classyage_1_1Vector4.html#acf752077d460438407ed3c84fe199f63":[5,0,0,21,7], -"classyage_1_1Vector4.html#ad6d84a870f51573b60490591cdbd8b4c":[5,0,0,21,4], -"classyage_1_1Vector4.html#ae0609f2db5e14fe05fddd71ec09f4735":[5,0,0,21,9], -"classyage_1_1Vector4.html#ae40311bf406263427426a7de5108c6c1":[5,0,0,21,1], -"classyage_1_1Window.html":[5,0,0,11], -"classyage_1_1Window.html#a0847f40df2aafd7da1c315fa84871f34":[5,0,0,11,12], -"classyage_1_1Window.html#a1225a2b5eff6d44a6bce3f0f5f10e2bf":[5,0,0,11,1], -"classyage_1_1Window.html#a1a311e27b1e588f0fce540ce040dcbd5":[5,0,0,11,10], -"classyage_1_1Window.html#a4be115daea6c7473fca81623c547d821":[5,0,0,11,2], -"classyage_1_1Window.html#a5247a4164bf0006fe9f034cd27c5b6db":[5,0,0,11,8], -"classyage_1_1Window.html#a5e3b209289bc343609d809d5b7f23cc8":[5,0,0,11,11], -"classyage_1_1Window.html#a7d7bd2f22e095df387e8b5cda2bb484e":[5,0,0,11,0], -"classyage_1_1Window.html#a86d0aa8e9896850b9acfc720b5615359":[5,0,0,11,13], -"classyage_1_1Window.html#a98c07656f90a6205f24dfe85ef1137de":[5,0,0,11,9], -"classyage_1_1Window.html#a98e2a33820ad63b2c94c56e203ff6e58":[5,0,0,11,4], -"classyage_1_1Window.html#a9a8dd109e145c459e52abb3a8861e3a0":[5,0,0,11,3], -"classyage_1_1Window.html#aa421df451f166dfe6441562e92b99115":[5,0,0,11,6], -"classyage_1_1Window.html#ae95d8670801c04af43da9e4fcc0e1006":[5,0,0,11,7], -"classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745":[5,0,0,11,5], -"classyage_1_1details_1_1Row.html":[5,0,0,0,1], -"classyage_1_1details_1_1Row.html#a18904acbce1c6084bc25a753989b5f06":[5,0,0,0,1,0], -"classyage_1_1details_1_1Row.html#a703d4eee36d93b1227ad734bdcf27190":[5,0,0,0,1,1], -"classyage_1_1details_1_1Row.html#adf2f7047871fdc78ba66d9d08cd07736":[5,0,0,0,1,2], -"collider_8h.html":[6,0,0,3,2], -"collider_8h_source.html":[6,0,0,3,2], -"collisionbody_8h.html":[6,0,0,3,3], -"collisionbody_8h_source.html":[6,0,0,3,3], -"deprecated.html":[2], -"dir_059f34b87ae2c2af887b23a7e5e8e88f.html":[6,0,0,4], -"dir_0a5be4b85c8e2c05f7a9f5a803f53125.html":[6,0,0], -"dir_11841e5da2063fc5766a682aee38e289.html":[6,0,0,0], -"dir_48a91ae829881cbedcfc124d2027890d.html":[6,0,0,5], -"dir_a58d7658bbcfd3d3d7296185ebe55c28.html":[6,0,0,3], -"dir_aa7f86daaaa64c448f636c0e65de2cec.html":[6,0,0,2], -"dir_d09e80fdcf0bb585bbe3b7099c52d028.html":[6,0,0,1], -"drawable_8h.html":[6,0,0,4,1], -"drawable_8h_source.html":[6,0,0,4,1], -"ellipse_8h.html":[6,0,0,4,2], -"ellipse_8h_source.html":[6,0,0,4,2], -"files.html":[6,0], -"functions.html":[5,3,0], -"functions.html":[5,3,0,0], -"functions_b.html":[5,3,0,1], -"functions_c.html":[5,3,0,2], -"functions_d.html":[5,3,0,3], -"functions_e.html":[5,3,0,4], -"functions_f.html":[5,3,0,5], -"functions_func.html":[5,3,1] -}; diff --git a/navtreeindex1.js b/navtreeindex1.js deleted file mode 100644 index 988c478a..00000000 --- a/navtreeindex1.js +++ /dev/null @@ -1,253 +0,0 @@ -var NAVTREEINDEX1 = -{ -"functions_g.html":[5,3,0,6], -"functions_h.html":[5,3,0,7], -"functions_i.html":[5,3,0,8], -"functions_k.html":[5,3,0,9], -"functions_l.html":[5,3,0,10], -"functions_m.html":[5,3,0,11], -"functions_n.html":[5,3,0,12], -"functions_o.html":[5,3,0,13], -"functions_p.html":[5,3,0,14], -"functions_r.html":[5,3,0,15], -"functions_rela.html":[5,3,4], -"functions_s.html":[5,3,0,16], -"functions_t.html":[5,3,0,17], -"functions_type.html":[5,3,3], -"functions_u.html":[5,3,0,18], -"functions_v.html":[5,3,0,19], -"functions_vars.html":[5,3,2], -"functions_w.html":[5,3,0,20], -"functions_x.html":[5,3,0,21], -"functions_y.html":[5,3,0,22], -"functions_z.html":[5,3,0,23], -"functions_~.html":[5,3,0,24], -"globals.html":[6,1,0], -"globals_defs.html":[6,1,5], -"globals_eval.html":[6,1,4], -"globals_func.html":[6,1,1], -"globals_type.html":[6,1,3], -"globals_vars.html":[6,1,2], -"hierarchy.html":[5,2], -"imageloader_8cpp.html":[6,0,0,0,2], -"imageloader_8h.html":[6,0,0,0,3], -"imageloader_8h_source.html":[6,0,0,0,3], -"index.html":[], -"input_8h.html":[6,0,0,1,0], -"input_8h.html#a088324ad8995e3eb76024e3e79083d48":[6,0,0,1,0,0], -"input_8h.html#ad5a9307442e5daa8810aff942564a822":[6,0,0,1,0,1], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a0123827c03dce5d07ebd43bd649a1073":[6,0,0,1,0,1,118], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a02129bb861061d1a052c592e2dc6b383":[6,0,0,1,0,1,42], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a0d61f8370cad1d412f80b84d143e1257":[6,0,0,1,0,1,21], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a1547ad05c44be2cc614be32159bf666b":[6,0,0,1,0,1,48], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a17de1e647789892e1fb512bf04db4866":[6,0,0,1,0,1,108], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a1a9c94725005bc4759507db8acc8da33":[6,0,0,1,0,1,105], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a1ab6dcd85380f2d3e882fbd2f6fda566":[6,0,0,1,0,1,49], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a1faf42f2823f184eb2c9f0dffe5d73f2":[6,0,0,1,0,1,75], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a2091809ab6bdbc0a1975bf61d6099748":[6,0,0,1,0,1,101], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a2140df7839a3713724b35168defcc975":[6,0,0,1,0,1,107], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a21507b40c80068eda19865706fdc2403":[6,0,0,1,0,1,57], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a21c2e59531c8710156d34a3c30ac81d5":[6,0,0,1,0,1,44], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a22517dfceb401f35b1b59999ba74c700":[6,0,0,1,0,1,7], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a2468649b6215c4cdd2aef5095b3f5932":[6,0,0,1,0,1,83], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a291554596c183e837f0a6bec3767c891":[6,0,0,1,0,1,69], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a2cfe3b4f9911c5899d79f171d6b9cc4a":[6,0,0,1,0,1,111], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a2d0bfa737eccfce7842cd2230eed6712":[6,0,0,1,0,1,97], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a30808a0391df7790292aa5c13f6195e4":[6,0,0,1,0,1,109], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a324bf1f059b99e2882bc1d567080d8ed":[6,0,0,1,0,1,66], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a32f68a60cef40faedbc6af20298c1a1e":[6,0,0,1,0,1,56], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a331b3100a485d8cacff1d3df8e9b0c13":[6,0,0,1,0,1,52], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a37f438df6a6d5ba4c17ef8ca58562f00":[6,0,0,1,0,1,74], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a3a3ea00cfc35332cedf6e5e9a32e94da":[6,0,0,1,0,1,23], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a3a92f3bbf26e4ea5ea7ce7db2f432c56":[6,0,0,1,0,1,114], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a3d548437292c0cd1662fc30d420f2c27":[6,0,0,1,0,1,104], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a3ed53fbeb1eab0443561b68ca0c0b5cf":[6,0,0,1,0,1,120], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a44c29edb103a2872f519ad0c9a0fdaaa":[6,0,0,1,0,1,34], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a47489eb597b7db34caa24b1fc78fc839":[6,0,0,1,0,1,76], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a4787509ad9f9d747a81a30e9dde3d4a7":[6,0,0,1,0,1,77], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a4b6bf4b531770872d4328ce69bef5627":[6,0,0,1,0,1,72], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a4c614360da93c0a041b22e537de151eb":[6,0,0,1,0,1,39], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a4d9b3e9fc12849d060371eb65154c751":[6,0,0,1,0,1,3], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a5206560a306a2e085a437fd258eb57ce":[6,0,0,1,0,1,40], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a56d8353718e6fdc78b8d69078a2cdb94":[6,0,0,1,0,1,85], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a57cec4137b614c87cb4e24a3d003a3e0":[6,0,0,1,0,1,43], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a5dbc98dcc983a70728bd082d1a47546e":[6,0,0,1,0,1,37], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a61e9c06ea9a85a5088a499df6458d276":[6,0,0,1,0,1,41], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a61ee777e7f71dc466c3b2c685d8d313b":[6,0,0,1,0,1,55], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a62e75b78c155e8549c5c5edb434a7757":[6,0,0,1,0,1,103], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a63a707029860972efa1c44ac6016e098":[6,0,0,1,0,1,116], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a643b0662422d1d0dffa3fca2e2bf28a8":[6,0,0,1,0,1,80], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a646da671ca01bb5d84dbb5fb2238dc8e":[6,0,0,1,0,1,6], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a6506ae39fdca9845e3a6de3865183e57":[6,0,0,1,0,1,1], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a65d3215a061ffc8962994cdf549e31e4":[6,0,0,1,0,1,14], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a684d325a7303f52e64011467ff5c5758":[6,0,0,1,0,1,58], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a69691c7bdcc3ce6d5d8a1361f22d04ac":[6,0,0,1,0,1,31], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a696b031073e74bf2cb98e5ef201d4aa3":[6,0,0,1,0,1,0], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a6e2e9ebea6f89bc9235928b0794bc261":[6,0,0,1,0,1,12], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a6f5d8e41084b4d3d47fa621c459eede1":[6,0,0,1,0,1,54], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a710533dd879dd1202e5c73b27705bf02":[6,0,0,1,0,1,63], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a71ddb986230a88155bf74e65f644dda4":[6,0,0,1,0,1,8], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a71f42e8faf0fb7cb14174c8481461c00":[6,0,0,1,0,1,102], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a766b4a88cba7645629bac70fd01d8275":[6,0,0,1,0,1,98], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a77e9eee7c579eef5f3731ecf1053c02e":[6,0,0,1,0,1,90], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a78232351eaf00755d136afad0745157b":[6,0,0,1,0,1,9], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a7c333963ed187368820c5343b355e5bc":[6,0,0,1,0,1,106], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a7fa06ead699fcbd63132370ffe13335a":[6,0,0,1,0,1,91], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a7fc56270e7a70fa81a5935b72eacbe29":[6,0,0,1,0,1,19], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a800618943025315f869e4e1f09471012":[6,0,0,1,0,1,24], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a80cdb34a10d276950f8b20b6814c9194":[6,0,0,1,0,1,117], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a810b30cdfc07fd7fff553a94b828ff78":[6,0,0,1,0,1,87], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a853f8ded7a96b5a765704974e6a3ca96":[6,0,0,1,0,1,68], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a8825bb5d58b44b72465799553acb964d":[6,0,0,1,0,1,119], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a889645d530078147e7dc69a9caadc31e":[6,0,0,1,0,1,92], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a892a245e287c163080b23db737d3c4c9":[6,0,0,1,0,1,78], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a8d9c307cb7f3c4a32822a51922d1ceaa":[6,0,0,1,0,1,32], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a91a9360a45bb242906ee86ecbf9ac7c4":[6,0,0,1,0,1,45], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a91d8d0b84f26c3e30fb064ea4fc1090f":[6,0,0,1,0,1,47], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a95dfde4807d4d6a9eec499203b3c24a0":[6,0,0,1,0,1,82], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a969f331a87d8c958473c32b4d0e61a44":[6,0,0,1,0,1,18], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a9c56f942b051ba23447e108e16a8b23b":[6,0,0,1,0,1,99], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a9d5ed678fe57bcca610140957afab571":[6,0,0,1,0,1,20], -"input_8h.html#ad5a9307442e5daa8810aff942564a822a9df35983f4024e31955de0f1e545e888":[6,0,0,1,0,1,2], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aa5f3c6a11b03839d46af9fb43c97c188":[6,0,0,1,0,1,29], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aa8ecc4d78b0864cd22b788de2b48921f":[6,0,0,1,0,1,13], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aabf9846f265ae3dea4bf9d740f5cb1aa":[6,0,0,1,0,1,94], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ab1a326c06d88bf042f73d70f50197905":[6,0,0,1,0,1,64], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ab213ce22ca6ad4eda8db82966b9b6e5a":[6,0,0,1,0,1,79], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ab6c7e6204e97690efd79d6f513ed5613":[6,0,0,1,0,1,112], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ab9ece18c950afbfa6b0fdbfa4ff731d3":[6,0,0,1,0,1,38], -"input_8h.html#ad5a9307442e5daa8810aff942564a822abaaceccc27b1d4e0968c999583f97de5":[6,0,0,1,0,1,17], -"input_8h.html#ad5a9307442e5daa8810aff942564a822abb2cbd684a16faa1624ae1b3a4ceaa2c":[6,0,0,1,0,1,16], -"input_8h.html#ad5a9307442e5daa8810aff942564a822abb4e75dde7d107cc573c77dc42a7acab":[6,0,0,1,0,1,11], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ac1d9f50f86825a1a2302ec2449c17196":[6,0,0,1,0,1,26], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ac4e0e4e3118472beeb2ae75827450f1f":[6,0,0,1,0,1,59], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ac63bd90003103ca242fe9202fe10c3e9":[6,0,0,1,0,1,15], -"input_8h.html#ad5a9307442e5daa8810aff942564a822acb0d0bf9279e78f982deba761110e434":[6,0,0,1,0,1,67], -"input_8h.html#ad5a9307442e5daa8810aff942564a822acb8104ace1979f9537c7f40de0622a22":[6,0,0,1,0,1,50], -"input_8h.html#ad5a9307442e5daa8810aff942564a822acd7c2a221ef5d0a34acc0bcd679b2054":[6,0,0,1,0,1,88], -"input_8h.html#ad5a9307442e5daa8810aff942564a822acf6d2dfd5fb43f33ec09dbad7a90593c":[6,0,0,1,0,1,10], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ad20caec3b48a1eef164cb4ca81ba2587":[6,0,0,1,0,1,30], -"input_8h.html#ad5a9307442e5daa8810aff942564a822adaaedac409335b869929ea43fa44be5d":[6,0,0,1,0,1,51], -"input_8h.html#ad5a9307442e5daa8810aff942564a822adc271d081ca9fcbefdc42998313398d8":[6,0,0,1,0,1,100], -"input_8h.html#ad5a9307442e5daa8810aff942564a822add7536794b63bf90eccfd37f9b147d7f":[6,0,0,1,0,1,27], -"input_8h.html#ad5a9307442e5daa8810aff942564a822addf133566f544b297f2f84874c283589":[6,0,0,1,0,1,113], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ade58a28573783fe95304a260ccd90362":[6,0,0,1,0,1,5], -"input_8h.html#ad5a9307442e5daa8810aff942564a822adea24610606fb34c587a8fe8ed8f8389":[6,0,0,1,0,1,110], -"input_8h.html#ad5a9307442e5daa8810aff942564a822adfcf28d0734569a6a693bc8194de62bf":[6,0,0,1,0,1,25], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae1dffc8709f31a4987c8a88334107e89":[6,0,0,1,0,1,70], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae1e1d3d40573127e9ee0480caf1283d6":[6,0,0,1,0,1,36], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae40af1d5cc55c55ae0bb25953f7a7ee2":[6,0,0,1,0,1,65], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae53b55851b9ff4979f2c3ff434a4a138":[6,0,0,1,0,1,84], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae791d936f894ce58dd18bf603edcb9b4":[6,0,0,1,0,1,61], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae7e0e72401a9f2718ed0f39f2861d702":[6,0,0,1,0,1,73], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae902674982fc99aa343cdd94da7476c3":[6,0,0,1,0,1,81], -"input_8h.html#ad5a9307442e5daa8810aff942564a822ae9a23c5ce3d34b40123d65ca14b2e88f":[6,0,0,1,0,1,62], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aebd7820c520d05eca2d775c37d141273":[6,0,0,1,0,1,93], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aecb4a6f3440c2ed0dff59f17375a27c0":[6,0,0,1,0,1,46], -"input_8h.html#ad5a9307442e5daa8810aff942564a822af09564c9ca56850d4cd6b3319e541aee":[6,0,0,1,0,1,35], -"input_8h.html#ad5a9307442e5daa8810aff942564a822af186217753c37b9b9f958d906208506e":[6,0,0,1,0,1,33], -"input_8h.html#ad5a9307442e5daa8810aff942564a822af447f5c03508de4d88e340390ba7c78f":[6,0,0,1,0,1,121], -"input_8h.html#ad5a9307442e5daa8810aff942564a822af623e75af30e62bbd73d6df5b50bb7b5":[6,0,0,1,0,1,22], -"input_8h.html#ad5a9307442e5daa8810aff942564a822af684bf05fa3e81528c84d1d281d839f1":[6,0,0,1,0,1,53], -"input_8h.html#ad5a9307442e5daa8810aff942564a822afbaedde498cdead4f2780217646e9ba1":[6,0,0,1,0,1,60], -"input_8h.html#ad5a9307442e5daa8810aff942564a822afc335adb3d69d3d8270769e1923ea4dc":[6,0,0,1,0,1,89], -"input_8h.html#ad5a9307442e5daa8810aff942564a822afd816cf0346d4939b4cf3bed78dd7fde":[6,0,0,1,0,1,115], -"input_8h.html#ad5a9307442e5daa8810aff942564a822afdcbdc22f7e22388bf5905c290bcfe4b":[6,0,0,1,0,1,96], -"input_8h.html#ad5a9307442e5daa8810aff942564a822afe5c3684dce76cdd9f7f42430868aa74":[6,0,0,1,0,1,71], -"input_8h.html#ad5a9307442e5daa8810aff942564a822aff44570aca8241914870afbc310cdb85":[6,0,0,1,0,1,28], -"input_8h.html#ad5a9307442e5daa8810aff942564a822affa5882d1ddcf903bf0d0dbc30bfc604":[6,0,0,1,0,1,86], -"input_8h.html#ad5a9307442e5daa8810aff942564a822affb2ce8868d49c78376bf7e76c88fd52":[6,0,0,1,0,1,95], -"input_8h.html#ad5a9307442e5daa8810aff942564a822affc0d9b54a1fe677c4c9e6b050e67c81":[6,0,0,1,0,1,4], -"input_8h_source.html":[6,0,0,1,0], -"iomanager_8cpp.html":[6,0,0,0,4], -"iomanager_8h.html":[6,0,0,0,5], -"iomanager_8h_source.html":[6,0,0,0,5], -"logger_8cpp.html":[6,0,0,0,6], -"logger_8h.html":[6,0,0,0,7], -"logger_8h.html#a0061fe08a4e2d9ed843a782044d3528f":[6,0,0,0,7,1], -"logger_8h.html#a17afd33b46d111ec5e97f20e2c667e2d":[6,0,0,0,7,5], -"logger_8h.html#a89062c0e6f5d9d0dd34553259c0fe00e":[6,0,0,0,7,3], -"logger_8h.html#a9055939896a9ae18d3a833c5023e98d1":[6,0,0,0,7,4], -"logger_8h.html#ac26448787b9e07f1cf6e928e23ef9b7a":[6,0,0,0,7,6], -"logger_8h.html#ac71f194a096b3d7b4cf4ec448ee8b87d":[6,0,0,0,7,2], -"logger_8h_source.html":[6,0,0,0,7], -"loglevel_8h.html":[6,0,0,0,8], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788":[6,0,0,0,8,0], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a059e9861e0400dfbe05c98a841f3f96b":[6,0,0,0,8,0,2], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a19da7170bea36556dde582519795f3fc":[6,0,0,0,8,0,4], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788a551b723eafd6a31d444fcb2f5920fbd3":[6,0,0,0,8,0,1], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788abb1ca97ec761fc37101737ba0aa2e7c5":[6,0,0,0,8,0,3], -"loglevel_8h.html#a4ac616fa26af17775ed558a4c08e4788adc30ec20708ef7b0f641ef78b7880a15":[6,0,0,0,8,0,0], -"loglevel_8h_source.html":[6,0,0,0,8], -"logmessage_8cpp.html":[6,0,0,0,9], -"logmessage_8h.html":[6,0,0,0,10], -"logmessage_8h_source.html":[6,0,0,0,10], -"logsink_8cpp.html":[6,0,0,0,11], -"logsink_8cpp.html#a6b288197f6a97f197dda60e5b54f1841":[6,0,0,0,11,2], -"logsink_8cpp.html#ab54350a8dbf59338c99ab4f43cfa2858":[6,0,0,0,11,0], -"logsink_8cpp.html#ad537beeea51c8314e407fadd24affc34":[6,0,0,0,11,1], -"logsink_8cpp.html#ae3c7a5bad8dd0db0a0a9cdd60c7b53d1":[6,0,0,0,11,3], -"logsink_8h.html":[6,0,0,0,12], -"logsink_8h.html#a6b288197f6a97f197dda60e5b54f1841":[6,0,0,0,12,3], -"logsink_8h.html#ab54350a8dbf59338c99ab4f43cfa2858":[6,0,0,0,12,1], -"logsink_8h.html#ad537beeea51c8314e407fadd24affc34":[6,0,0,0,12,2], -"logsink_8h_source.html":[6,0,0,0,12], -"matrix_8h.html":[6,0,0,2,0], -"matrix_8h.html#a090cbd6b767b583364e9cbe78d8a8d5a":[6,0,0,2,0,19], -"matrix_8h.html#a12811c7f985dbbdc34e4d93a26d21763":[6,0,0,2,0,10], -"matrix_8h.html#a1896ae5c4cfed1453dadf21a4a2a48cf":[6,0,0,2,0,14], -"matrix_8h.html#a2187fb11298a029f2877702192717090":[6,0,0,2,0,23], -"matrix_8h.html#a226cc29763f745fd175844f4263d5dae":[6,0,0,2,0,20], -"matrix_8h.html#a23eef341099a6b2816cf0c63f8ffe898":[6,0,0,2,0,7], -"matrix_8h.html#a277125ad9fa06a7119c59d350e129985":[6,0,0,2,0,17], -"matrix_8h.html#a438e5eeb3daf58452259f7534e8818e8":[6,0,0,2,0,13], -"matrix_8h.html#a57e09b8310398c434e9526ea5cc456ad":[6,0,0,2,0,9], -"matrix_8h.html#a5ddd829cb1c7c4c880d0fd53326858fe":[6,0,0,2,0,28], -"matrix_8h.html#a62de4b4b6bab23717d957c370f2e41c7":[6,0,0,2,0,29], -"matrix_8h.html#a6455fea9bfa32e435fbf77e02ce12759":[6,0,0,2,0,15], -"matrix_8h.html#a6b77afaa1cd077df90b9daccbfc2cbae":[6,0,0,2,0,21], -"matrix_8h.html#a747a31edd11312cbae25ebb9ab12d5cb":[6,0,0,2,0,12], -"matrix_8h.html#a7ed614bc9d3e8b9f3f8d32b6a7ff28eb":[6,0,0,2,0,27], -"matrix_8h.html#a8a9db24697f649f6d19f0347330d95fe":[6,0,0,2,0,24], -"matrix_8h.html#a947133b8fc764d9fc5c5d8b08821cf32":[6,0,0,2,0,22], -"matrix_8h.html#ac4d2f55a5c3369ec42001776a582c30a":[6,0,0,2,0,16], -"matrix_8h.html#acca4a23afb94173695bbc1e1f2cde2b3":[6,0,0,2,0,26], -"matrix_8h.html#ad8903f6a93ac89f16846458540717507":[6,0,0,2,0,18], -"matrix_8h.html#ad9344d41af72f29cd6f8cf1ef62ed3cc":[6,0,0,2,0,25], -"matrix_8h.html#ae04792ab12e05bcb11c0316b142ebeec":[6,0,0,2,0,11], -"matrix_8h.html#aea25e39fde2b6a8abab71cc27371d339":[6,0,0,2,0,8], -"matrix_8h_source.html":[6,0,0,2,0], -"md_yage_physics_README.html":[0], -"namespacemembers.html":[4,1,0], -"namespacemembers_enum.html":[4,1,3], -"namespacemembers_eval.html":[4,1,4], -"namespacemembers_func.html":[4,1,1], -"namespacemembers_type.html":[4,1,2], -"namespaces.html":[4,0], -"namespaceyage.html":[4,0,0], -"namespaceyage.html":[5,0,0], -"namespaceyage_1_1details.html":[4,0,0,0], -"namespaceyage_1_1details.html":[5,0,0,0], -"namespaceyage_1_1matrix.html":[5,0,0,1], -"namespaceyage_1_1matrix.html":[4,0,0,1], -"pages.html":[], -"particlebody_8cpp.html":[6,0,0,3,4], -"particlebody_8h.html":[6,0,0,3,5], -"particlebody_8h_source.html":[6,0,0,3,5], -"physics_8h.html":[6,0,0,3,6], -"physics_8h_source.html":[6,0,0,3,6], -"rectangle_8cpp.html":[6,0,0,4,3], -"rectangle_8h.html":[6,0,0,4,4], -"rectangle_8h_source.html":[6,0,0,4,4], -"rectanglecollider_8cpp.html":[6,0,0,3,7], -"rectanglecollider_8h.html":[6,0,0,3,8], -"rectanglecollider_8h_source.html":[6,0,0,3,8], -"resourcemanager_8cpp.html":[6,0,0,0,13], -"resourcemanager_8h.html":[6,0,0,0,14], -"resourcemanager_8h_source.html":[6,0,0,0,14], -"rigidbody_8cpp.html":[6,0,0,3,9], -"rigidbody_8h.html":[6,0,0,3,10], -"rigidbody_8h_source.html":[6,0,0,3,10], -"shader_8cpp.html":[6,0,0,4,5], -"shader_8h.html":[6,0,0,4,6] -}; diff --git a/navtreeindex2.js b/navtreeindex2.js deleted file mode 100644 index 4e738592..00000000 --- a/navtreeindex2.js +++ /dev/null @@ -1,153 +0,0 @@ -var NAVTREEINDEX2 = -{ -"shader_8h_source.html":[6,0,0,4,6], -"shape_8h.html":[6,0,0,4,7], -"shape_8h_source.html":[6,0,0,4,7], -"sprite_8cpp.html":[6,0,0,4,8], -"sprite_8h.html":[6,0,0,4,9], -"sprite_8h_source.html":[6,0,0,4,9], -"spritebatch_8cpp.html":[6,0,0,4,10], -"spritebatch_8h.html":[6,0,0,4,11], -"spritebatch_8h_source.html":[6,0,0,4,11], -"spritesheet_8cpp.html":[6,0,0,0,15], -"spritesheet_8h.html":[6,0,0,0,16], -"spritesheet_8h.html#a035f63ad1a3114ada8157ed4182521c9":[6,0,0,0,16,2], -"spritesheet_8h_source.html":[6,0,0,0,16], -"stb__image_8cpp.html":[6,0,0,0,17], -"stb__image_8cpp.html#a18372412ad2fc3ce1e3240b3cf0efe78":[6,0,0,0,17,0], -"stb__image_8h.html":[6,0,0,0,18], -"stb__image_8h.html#a038b0e741859a482b8b9d60167e54d27":[6,0,0,0,18,42], -"stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba0177ac2c5002f4f251bb766d41752029":[6,0,0,0,18,5], -"stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baa59123e5d0af25f9b1539f5cf1facddf":[6,0,0,0,18,8], -"stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baa7b1af0c9f0310c3ada2aa29a32de293":[6,0,0,0,18,9], -"stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55bad1eb95ca1fa7706bf732bf35a0ed40aa":[6,0,0,0,18,6], -"stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baf5829d16d4cca6077465c5abd346e2f8":[6,0,0,0,18,7], -"stb__image_8h.html#a0d12efc011adfff7521f3b924feb0b0e":[6,0,0,0,18,43], -"stb__image_8h.html#a1feccdcf726dcc6b5502e3efa85b7dbb":[6,0,0,0,18,23], -"stb__image_8h.html#a23525ef2b882f3de426b47ecf8d9151b":[6,0,0,0,18,10], -"stb__image_8h.html#a28abedef4a0a93909332080df6be0021":[6,0,0,0,18,17], -"stb__image_8h.html#a28eb51a1512ce382ee50f20e1d04d50d":[6,0,0,0,18,3], -"stb__image_8h.html#a2d9ec9850cd12aefe7641b456266a4c2":[6,0,0,0,18,2], -"stb__image_8h.html#a3f02e0053e1c8d08a3ed436e6a82c7c9":[6,0,0,0,18,38], -"stb__image_8h.html#a4919b67b12e0e3acc5301f185ca77e2e":[6,0,0,0,18,40], -"stb__image_8h.html#a5cbc6f5cbb3b2d0d87ee959fcee9d23e":[6,0,0,0,18,22], -"stb__image_8h.html#a5d47fb76ce1e34eb0729ad932c9c48e2":[6,0,0,0,18,36], -"stb__image_8h.html#a648037d4c55689328ba08c8f5d293df2":[6,0,0,0,18,4], -"stb__image_8h.html#a6e7fd261af79ecef2208df3a6cc806bb":[6,0,0,0,18,34], -"stb__image_8h.html#a7fbd65c83495f13f22469fe493775739":[6,0,0,0,18,44], -"stb__image_8h.html#a82bcc0957b6a4ebfdfa3d7f04fbaed18":[6,0,0,0,18,27], -"stb__image_8h.html#a86291c64cb663f41a34647d5e1abf363":[6,0,0,0,18,16], -"stb__image_8h.html#a8a58b6bcd805afa1bdb14f988dd37fee":[6,0,0,0,18,26], -"stb__image_8h.html#a95ebc5c42c1a753200be8d465e933af7":[6,0,0,0,18,29], -"stb__image_8h.html#a9ca2591f0987284129e82bf9dbcf7c6c":[6,0,0,0,18,31], -"stb__image_8h.html#aa874b3ba909f3281d499894909678336":[6,0,0,0,18,11], -"stb__image_8h.html#aa9994764695597161e8f3776e97caa99":[6,0,0,0,18,30], -"stb__image_8h.html#aaaa17a529bec51403cc23dc2e7c36d79":[6,0,0,0,18,41], -"stb__image_8h.html#aaf10d41631e1e9214fde1688bdbd8524":[6,0,0,0,18,21], -"stb__image_8h.html#ab18889e43518d6b4421b705782bb1b5e":[6,0,0,0,18,12], -"stb__image_8h.html#ab89c177fc52f1bb2dc1c05e48129a0a4":[6,0,0,0,18,37], -"stb__image_8h.html#acae25d31bfae29d75482f07fecf2935f":[6,0,0,0,18,32], -"stb__image_8h.html#ace82446ecd7b5c760cde062179660f46":[6,0,0,0,18,35], -"stb__image_8h.html#acfef077febce3bc3f1f339de478f3315":[6,0,0,0,18,18], -"stb__image_8h.html#ad30fd870ed2138ce8f38c9dd29b2f76a":[6,0,0,0,18,28], -"stb__image_8h.html#ad3e11bb44412a7ba348acfbad09caacb":[6,0,0,0,18,14], -"stb__image_8h.html#ae21cc1184eeb5cc814699f1ed62c5258":[6,0,0,0,18,13], -"stb__image_8h.html#ae70f9a302f7e87fd971075e7f758d55c":[6,0,0,0,18,19], -"stb__image_8h.html#ae8447830c49bc17f8491e12c1f0ded48":[6,0,0,0,18,39], -"stb__image_8h.html#aed6cd14a3bf678808c4c179e808866aa":[6,0,0,0,18,1], -"stb__image_8h.html#aede708cca1304520b2afcf4d5eb61d70":[6,0,0,0,18,15], -"stb__image_8h.html#aefdc7387857a14894bbf321e9ea4f048":[6,0,0,0,18,25], -"stb__image_8h.html#af0e94f316fe1848f632517ca3c11d077":[6,0,0,0,18,20], -"stb__image_8h.html#af4f17acd30945a75901fdc022f90575f":[6,0,0,0,18,33], -"stb__image_8h.html#af946583656a362a316b40c0421c20561":[6,0,0,0,18,24], -"stb__image_8h_source.html":[6,0,0,0,18], -"structstbi__io__callbacks.html":[5,0,1], -"structstbi__io__callbacks.html#a2c4f3c3b7c75a2e74a35caf74fb8d177":[5,0,1,0], -"structstbi__io__callbacks.html#a73818f0a4f467e5abfefb1d635f62d82":[5,0,1,1], -"structstbi__io__callbacks.html#a864be557872041ac06e1509caf05cc83":[5,0,1,2], -"structyage_1_1Colour.html":[5,0,0,14], -"structyage_1_1Colour.html#a205d3a63268f4879adf27aabdf71a6dd":[5,0,0,14,4], -"structyage_1_1Colour.html#a572fe7933c59ebfa6720088cd33dad99":[5,0,0,14,5], -"structyage_1_1Colour.html#a585165d5109c81b6b2de6f1116406abd":[5,0,0,14,0], -"structyage_1_1Colour.html#a5aef37a5ac37e44dc32f5f9b1ebee10c":[5,0,0,14,2], -"structyage_1_1Colour.html#a7bd3ed4a377c384af80aa8c7f55dc96f":[5,0,0,14,3], -"structyage_1_1Colour.html#a8118ad802db7e61df770f7d3b5b88aaa":[5,0,0,14,1], -"structyage_1_1LogMessage_1_1Meta.html":[5,0,0,6,0], -"structyage_1_1LogMessage_1_1Meta.html#aa265c76e7ce54e4b912e1c41333fad3b":[5,0,0,6,0,1], -"structyage_1_1LogMessage_1_1Meta.html#ac2951995b1f4ebf28e94bcd268c3dd3c":[5,0,0,6,0,2], -"structyage_1_1LogMessage_1_1Meta.html#ae3ef1b01f47ef6254b8aa6fce13db7c4":[5,0,0,6,0,0], -"structyage_1_1Position.html":[5,0,0,13], -"structyage_1_1Position.html#a41b1d5ee23c50208982ab6089708e5d2":[5,0,0,13,0], -"structyage_1_1Position.html#a45b8cc8245d0e05bb9e482d85512ee27":[5,0,0,13,3], -"structyage_1_1Position.html#a4f5904d6d7b22802211f0565bc9f6c91":[5,0,0,13,2], -"structyage_1_1Position.html#aaeaa1cd93e57adcb08ef4f76513148e2":[5,0,0,13,1], -"structyage_1_1Texture.html":[5,0,0,12], -"structyage_1_1Texture.html#a0cef080bceaaf5e702985f5494ea35d5":[5,0,0,12,0], -"structyage_1_1Texture.html#a26386c2709b906ec07c9a1bb8daf2968":[5,0,0,12,3], -"structyage_1_1Texture.html#a4bfae86da1ef1930238291660223a8f0":[5,0,0,12,6], -"structyage_1_1Texture.html#a5ce16ac8ad034f7042620a418783b41e":[5,0,0,12,2], -"structyage_1_1Texture.html#a7ecf257a7663cb0523d41c0519380046":[5,0,0,12,5], -"structyage_1_1Texture.html#ad42f41cc57ed7a20928382f6557dc598":[5,0,0,12,4], -"structyage_1_1Texture.html#af0a85aa4202d12fca9c1f52085d26850":[5,0,0,12,1], -"structyage_1_1UV.html":[5,0,0,15], -"structyage_1_1UV.html#a414dc7aeeebf47df1a991aacbb12a793":[5,0,0,15,3], -"structyage_1_1UV.html#aa726c11ba59a9a5edffef27ac3845053":[5,0,0,15,2], -"structyage_1_1UV.html#ac918524789292937aae5803df3c2673f":[5,0,0,15,1], -"structyage_1_1UV.html#ae236139f3a5f6024aac1e21bd93b7bde":[5,0,0,15,0], -"structyage_1_1Vertex.html":[5,0,0,16], -"structyage_1_1Vertex.html#a142db28be39f418a06fa43f75d386182":[5,0,0,16,5], -"structyage_1_1Vertex.html#a2d1923353f0e50e7753ff1ae2d9ba84e":[5,0,0,16,7], -"structyage_1_1Vertex.html#aa1fa8f5ebd883068828466cc924d4c50":[5,0,0,16,4], -"structyage_1_1Vertex.html#aa759435739e34e2a0bfd1803c2aeeddf":[5,0,0,16,2], -"structyage_1_1Vertex.html#aac3046359c44aeabc910a81f4f41789e":[5,0,0,16,1], -"structyage_1_1Vertex.html#abefe88d26b055655f9cc038a1dd4ff6a":[5,0,0,16,6], -"structyage_1_1Vertex.html#acae9697c2762e37dfa4472b85fa112c3":[5,0,0,16,0], -"structyage_1_1Vertex.html#af392248f0be173221ebcc62d490fe03d":[5,0,0,16,3], -"structyage_1_1details_1_1Coordinate.html":[5,0,0,0,0], -"structyage_1_1details_1_1Coordinate.html#a0b3a6d9aa1d5b846ad7ebc11bc77c629":[5,0,0,0,0,0], -"structyage_1_1details_1_1Coordinate.html#a23585afbdaa9bb742353a4c90878a941":[5,0,0,0,0,2], -"structyage_1_1details_1_1Coordinate.html#a43fb6bd3e325d5cd7ec436778605db2a":[5,0,0,0,0,1], -"structyage_1_1details_1_1Coordinate.html#a6d54c056ec7bd3c7ed1c6a226c2cf508":[5,0,0,0,0,5], -"structyage_1_1details_1_1Coordinate.html#aa1a9203c0a9cd929f333bd99af634adc":[5,0,0,0,0,4], -"structyage_1_1details_1_1Coordinate.html#aed145c923c95f852a8fb3abde8e346c0":[5,0,0,0,0,3], -"structyage_1_1details_1_1Glyph.html":[5,0,0,0,3], -"structyage_1_1details_1_1Glyph.html#a4dd2989e7b2a6d58dea6c85a9a1ed80d":[5,0,0,0,3,5], -"structyage_1_1details_1_1Glyph.html#a503ba9786cf0fe3535e968b607a001da":[5,0,0,0,3,6], -"structyage_1_1details_1_1Glyph.html#a91752b58fc10fb037658f27c9338627c":[5,0,0,0,3,0], -"structyage_1_1details_1_1Glyph.html#a9de1d469f98aa0411f8073fdc3aa39ed":[5,0,0,0,3,2], -"structyage_1_1details_1_1Glyph.html#aba58f02d34ba363ab3435e2328e4bfcc":[5,0,0,0,3,4], -"structyage_1_1details_1_1Glyph.html#ac42b2ed4a9179c38196953ed32bfa056":[5,0,0,0,3,1], -"structyage_1_1details_1_1Glyph.html#ae5398583bd0b4c1d6b334bf3902903d9":[5,0,0,0,3,3], -"structyage_1_1details_1_1RenderBatch.html":[5,0,0,0,2], -"structyage_1_1details_1_1RenderBatch.html#a27ed6f3911a6d7c8c2b6b4e5a5889b29":[5,0,0,0,2,1], -"structyage_1_1details_1_1RenderBatch.html#a48f630fdb7c1a3f4eecd05996b560844":[5,0,0,0,2,0], -"structyage_1_1details_1_1RenderBatch.html#a7f58b6967f0a68aa5624e0504c78a422":[5,0,0,0,2,2], -"structyage_1_1details_1_1RenderBatch.html#abf26b15420f34052270a1204d89ee687":[5,0,0,0,2,3], -"syncqueue_8h.html":[6,0,0,5,2], -"syncqueue_8h_source.html":[6,0,0,5,2], -"texture_8h.html":[6,0,0,1,1], -"texture_8h_source.html":[6,0,0,1,1], -"texturecache_8cpp.html":[6,0,0,0,19], -"texturecache_8h.html":[6,0,0,0,20], -"texturecache_8h_source.html":[6,0,0,0,20], -"todo.html":[1], -"vertex_8h.html":[6,0,0,1,2], -"vertex_8h_source.html":[6,0,0,1,2], -"window_8cpp.html":[6,0,0,0,21], -"window_8h.html":[6,0,0,0,22], -"window_8h.html#a09d41deeced5fca5df9dc680c9e77c38":[6,0,0,0,22,1], -"window_8h.html#a09d41deeced5fca5df9dc680c9e77c38a409ae568f380139ffa38d7fffa5ffb2f":[6,0,0,0,22,1,2], -"window_8h.html#a09d41deeced5fca5df9dc680c9e77c38a7c4273d3feb1dc60a55a74c37c3fddd6":[6,0,0,0,22,1,0], -"window_8h.html#a09d41deeced5fca5df9dc680c9e77c38af7a4d995b268c416a6e01b8dc1555648":[6,0,0,0,22,1,1], -"window_8h.html#a09d41deeced5fca5df9dc680c9e77c38afa8ece0eef17c604369ca69bc4b09970":[6,0,0,0,22,1,3], -"window_8h_source.html":[6,0,0,0,22], -"yage_8cpp.html":[6,0,0,6], -"yage_8cpp.html#a0bd2fedcbe862fdea1ea54b6b7d49bec":[6,0,0,6,0], -"yage_8cpp.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce":[6,0,0,6,1], -"yage_8cpp.html#ac9d8c7327204686b3c86f4ab48672618":[6,0,0,6,2], -"yage_8h.html":[6,0,0,7], -"yage_8h.html#a0bd2fedcbe862fdea1ea54b6b7d49bec":[6,0,0,7,0], -"yage_8h.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce":[6,0,0,7,1], -"yage_8h.html#ac9d8c7327204686b3c86f4ab48672618":[6,0,0,7,2], -"yage_8h_source.html":[6,0,0,7] -}; diff --git a/open.png b/open.png index 30f75c7e..ac5a1b12 100644 Binary files a/open.png and b/open.png differ diff --git a/pages.html b/pages.html index 2e2160e9..fc1160c0 100644 --- a/pages.html +++ b/pages.html @@ -8,13 +8,6 @@ - - - - - - + diff --git a/particlebody_8cpp.html b/particlebody_8cpp.html index dda09c65..ddc3a966 100644 --- a/particlebody_8cpp.html +++ b/particlebody_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -121,7 +105,7 @@ $(document).ready(function(){initNavTree('particlebody_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -129,15 +113,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/particlebody_8h.html b/particlebody_8h.html index 53354ceb..08e20f59 100644 --- a/particlebody_8h.html +++ b/particlebody_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/particlebody_8h_source.html b/particlebody_8h_source.html index f0baef88..c5a73762 100644 --- a/particlebody_8h_source.html +++ b/particlebody_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    particlebody.h
    @@ -143,15 +127,11 @@ $(document).ready(function(){initNavTree('particlebody_8h_source.html','');});
    Vector2< double > Vector2d
    Definition of a 2D vector.
    Definition: matrix.h:398
    void update() override
    Definition: particlebody.cpp:28
    - - + diff --git a/physics_8h.html b/physics_8h.html index dc9e5730..d9121e59 100644 --- a/physics_8h.html +++ b/physics_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    physics.h File Reference
    @@ -125,15 +109,11 @@ $(document).ready(function(){initNavTree('physics_8h.html','');});

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/physics_8h_source.html b/physics_8h_source.html index 391aad46..77027f4c 100644 --- a/physics_8h_source.html +++ b/physics_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    physics.h
    @@ -127,15 +111,11 @@ $(document).ready(function(){initNavTree('physics_8h_source.html','');});
    - - + diff --git a/rectangle_8cpp.html b/rectangle_8cpp.html index 1c79d3ca..dfaed42d 100644 --- a/rectangle_8cpp.html +++ b/rectangle_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -110,6 +94,10 @@ $(document).ready(function(){initNavTree('rectangle_8cpp.html','');});
    rectangle.cpp File Reference
    + +


    + +More...

    #include "rectangle.h"
    #include "../data/vertex.h"
    #include <glad/glad.h>
    @@ -118,19 +106,19 @@ $(document).ready(function(){initNavTree('rectangle_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
      -
    -
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    - + diff --git a/rectangle_8h.html b/rectangle_8h.html index 2582391c..5c8fdaa0 100644 --- a/rectangle_8h.html +++ b/rectangle_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -111,6 +95,10 @@ $(document).ready(function(){initNavTree('rectangle_8h.html','');});
    rectangle.h File Reference
    + +


    + +More...

    #include "shape.h"
    #include <glm/glm.hpp>
    @@ -124,19 +112,19 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
      -
    - +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    - + diff --git a/rectangle_8h_source.html b/rectangle_8h_source.html index 365923a3..4def4d99 100644 --- a/rectangle_8h_source.html +++ b/rectangle_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    rectangle.h
    -Go to the documentation of this file.
    1 #ifndef YAGE_RENDER_RECTANGLE_H
    -
    2 #define YAGE_RENDER_RECTANGLE_H
    -
    3 
    -
    4 #include "shape.h"
    -
    5 
    -
    6 #include <glm/glm.hpp>
    -
    7 
    -
    8 namespace yage
    -
    9 {
    -
    10 
    -
    11 class Rectangle : public Shape
    -
    12 {
    -
    13 public:
    -
    14  Rectangle(glm::vec4 position);
    -
    15  virtual void render() const;
    -
    16 
    -
    17 private:
    -
    18  glm::vec4 position_;
    -
    19 };
    -
    20 
    -
    21 } // namespace yage
    -
    22 
    -
    23 #endif
    -
    Definition: shape.h:9
    -
    virtual void render() const
    Definition: rectangle.cpp:14
    -
    Definition: rectangle.h:11
    -
    Rectangle(glm::vec4 position)
    Definition: rectangle.cpp:12
    - +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_RENDER_RECTANGLE_H
    +
    10 #define YAGE_RENDER_RECTANGLE_H
    +
    11 
    +
    12 #include "shape.h"
    +
    13 
    +
    14 #include <glm/glm.hpp>
    +
    15 
    +
    16 namespace yage
    +
    17 {
    +
    18 
    +
    19 class Rectangle : public Shape
    +
    20 {
    +
    21 public:
    +
    22  Rectangle(glm::vec4 position);
    +
    23  virtual void render() const;
    +
    24 
    +
    25 private:
    +
    26  glm::vec4 position_;
    +
    27 };
    +
    28 
    +
    29 } // namespace yage
    +
    30 
    +
    31 #endif
    +
    Definition: shape.h:17
    +
    virtual void render() const
    Definition: rectangle.cpp:22
    +
    Definition: rectangle.h:19
    +
    Rectangle(glm::vec4 position)
    Definition: rectangle.cpp:20
    +
    -
    - + diff --git a/rectanglecollider_8cpp.html b/rectanglecollider_8cpp.html index 2851c3e7..9b77f5cd 100644 --- a/rectanglecollider_8cpp.html +++ b/rectanglecollider_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -119,7 +103,7 @@ $(document).ready(function(){initNavTree('rectanglecollider_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -127,15 +111,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/rectanglecollider_8h.html b/rectanglecollider_8h.html index d1290754..d2835201 100644 --- a/rectanglecollider_8h.html +++ b/rectanglecollider_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/rectanglecollider_8h_source.html b/rectanglecollider_8h_source.html index 252c9b9b..44c3e974 100644 --- a/rectanglecollider_8h_source.html +++ b/rectanglecollider_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    rectanglecollider.h
    @@ -138,15 +122,11 @@ $(document).ready(function(){initNavTree('rectanglecollider_8h_source.html','');
    Definition: collider.h:19
    - - + diff --git a/resize.js b/resize.js deleted file mode 100644 index 304fcb6b..00000000 --- a/resize.js +++ /dev/null @@ -1,97 +0,0 @@ -var cookie_namespace = 'doxygen'; -var sidenav,navtree,content,header; - -function readCookie(cookie) -{ - var myCookie = cookie_namespace+"_"+cookie+"="; - if (document.cookie) - { - var index = document.cookie.indexOf(myCookie); - if (index != -1) - { - var valStart = index + myCookie.length; - var valEnd = document.cookie.indexOf(";", valStart); - if (valEnd == -1) - { - valEnd = document.cookie.length; - } - var val = document.cookie.substring(valStart, valEnd); - return val; - } - } - return 0; -} - -function writeCookie(cookie, val, expiration) -{ - if (val==undefined) return; - if (expiration == null) - { - var date = new Date(); - date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week - expiration = date.toGMTString(); - } - document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; -} - -function resizeWidth() -{ - var windowWidth = $(window).width() + "px"; - var sidenavWidth = $(sidenav).outerWidth(); - content.css({marginLeft:parseInt(sidenavWidth)+"px"}); - writeCookie('width',sidenavWidth, null); -} - -function restoreWidth(navWidth) -{ - var windowWidth = $(window).width() + "px"; - content.css({marginLeft:parseInt(navWidth)+6+"px"}); - sidenav.css({width:navWidth + "px"}); -} - -function resizeHeight() -{ - var headerHeight = header.outerHeight(); - var footerHeight = footer.outerHeight(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - content.css({height:windowHeight + "px"}); - navtree.css({height:windowHeight + "px"}); - sidenav.css({height:windowHeight + "px",top: headerHeight+"px"}); -} - -function initResizable() -{ - header = $("#top"); - sidenav = $("#side-nav"); - content = $("#doc-content"); - navtree = $("#nav-tree"); - footer = $("#nav-path"); - $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); - $(window).resize(function() { resizeHeight(); }); - var width = readCookie('width'); - if (width) { restoreWidth(width); } else { resizeWidth(); } - resizeHeight(); - var url = location.href; - var i=url.indexOf("#"); - if (i>=0) window.location.hash=url.substr(i); - var _preventDefault = function(evt) { evt.preventDefault(); }; - $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); - $(document).bind('touchmove',function(e){ - var device = navigator.userAgent.toLowerCase(); - var ios = device.match(/(iphone|ipod|ipad)/); - if (ios) { - try { - var target = e.target; - while (target) { - if ($(target).css('-webkit-overflow-scrolling')=='touch') return; - target = target.parentNode; - } - e.preventDefault(); - } catch(err) { - e.preventDefault(); - } - } - }); -} - - diff --git a/resourcemanager_8cpp.html b/resourcemanager_8cpp.html index 5da67abb..9c2d9fde 100644 --- a/resourcemanager_8cpp.html +++ b/resourcemanager_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -120,7 +104,7 @@ $(document).ready(function(){initNavTree('resourcemanager_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -128,15 +112,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/resourcemanager_8h.html b/resourcemanager_8h.html index fcf4601a..b3edc88c 100644 --- a/resourcemanager_8h.html +++ b/resourcemanager_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/resourcemanager_8h_source.html b/resourcemanager_8h_source.html index 1f94e244..99dc684b 100644 --- a/resourcemanager_8h_source.html +++ b/resourcemanager_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    resourcemanager.h
    @@ -140,15 +124,11 @@ $(document).ready(function(){initNavTree('resourcemanager_8h_source.html','');})
    Definition: texturecache.h:19
    static Texture getTexture(const std::string &texture_path, int x=1, int y=1)
    Definition: resourcemanager.cpp:17
    - - + diff --git a/rigidbody_8cpp.html b/rigidbody_8cpp.html index fd68536f..4bf93188 100644 --- a/rigidbody_8cpp.html +++ b/rigidbody_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -119,7 +103,7 @@ $(document).ready(function(){initNavTree('rigidbody_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -127,15 +111,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/rigidbody_8h.html b/rigidbody_8h.html index 47073f55..2ac1fa7d 100644 --- a/rigidbody_8h.html +++ b/rigidbody_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/rigidbody_8h_source.html b/rigidbody_8h_source.html index 7d452b30..8fd1862a 100644 --- a/rigidbody_8h_source.html +++ b/rigidbody_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    rigidbody.h
    @@ -136,15 +120,11 @@ $(document).ready(function(){initNavTree('rigidbody_8h_source.html','');});
    Vector2< double > Vector2d
    Definition of a 2D vector.
    Definition: matrix.h:398
    - - + diff --git a/search/all_0.js b/search/all_0.js index 5f5a017c..0ce2f521 100644 --- a/search/all_0.js +++ b/search/all_0.js @@ -7,6 +7,8 @@ var searchData= ['active_2ecpp',['active.cpp',['../active_8cpp.html',1,'']]], ['active_2eh',['active.h',['../active_8h.html',1,'']]], ['add',['add',['../classyage_1_1Logger.html#a5ec9a752e8cbb278342fdb49520fbcdd',1,'yage::Logger']]], + ['addsystem',['addSystem',['../classyage_1_1Engine.html#ab605c8ab3209e6cb1a8b0d45eb6180b6',1,'yage::Engine']]], ['apostrophe',['APOSTROPHE',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a9df35983f4024e31955de0f1e545e888',1,'yage']]], - ['applyforce',['applyForce',['../classyage_1_1Body.html#a56310be4f9d7d2d4e7f954af0e0a5878',1,'yage::Body::applyForce()'],['../classyage_1_1ParticleBody.html#a4d6c52fc2106ebd3f131d2be1fa3f11b',1,'yage::ParticleBody::applyForce()']]] + ['applyforce',['applyForce',['../classyage_1_1Body.html#a56310be4f9d7d2d4e7f954af0e0a5878',1,'yage::Body::applyForce()'],['../classyage_1_1ParticleBody.html#a4d6c52fc2106ebd3f131d2be1fa3f11b',1,'yage::ParticleBody::applyForce()']]], + ['add_20comments',['Add Comments',['../md_docs_todolist.html',1,'']]] ]; diff --git a/search/all_12.js b/search/all_12.js index 6dcf5bd4..885b2d7a 100644 --- a/search/all_12.js +++ b/search/all_12.js @@ -9,8 +9,8 @@ var searchData= ['setposition',['setPosition',['../structyage_1_1Vertex.html#af392248f0be173221ebcc62d490fe03d',1,'yage::Vertex']]], ['setuniform',['setUniform',['../classyage_1_1Shader.html#ac9bff8500e2adfa1745c843bc612f215',1,'yage::Shader::setUniform(const std::string &name, int value) const '],['../classyage_1_1Shader.html#a1a637a37d3e72fe1cd53602e80ab23ab',1,'yage::Shader::setUniform(const std::string &name, float value) const '],['../classyage_1_1Shader.html#a96c50a15f45d064f43d1f01e84105e78',1,'yage::Shader::setUniform(const std::string &name, const glm::mat4 &matrix) const ']]], ['setuv',['setUv',['../structyage_1_1Vertex.html#aa1fa8f5ebd883068828466cc924d4c50',1,'yage::Vertex']]], - ['shader',['Shader',['../classyage_1_1Shader.html',1,'yage']]], ['shader',['Shader',['../classyage_1_1Shader.html#a34fe30eb6e6d595c1996e8ea6fb3961a',1,'yage::Shader::Shader(const std::string &vertex_path, const std::string &fragment_path)'],['../classyage_1_1Shader.html#a1a006dcb52a4fb9f1dc61df68d3676f5',1,'yage::Shader::Shader(const Shader &)=delete'],['../classyage_1_1Shader.html#adf6dc3a526921d62b55a552f38958dd2',1,'yage::Shader::Shader(Shader &&)=delete']]], + ['shader',['Shader',['../classyage_1_1Shader.html',1,'yage']]], ['shader_2ecpp',['shader.cpp',['../shader_8cpp.html',1,'']]], ['shader_2eh',['shader.h',['../shader_8h.html',1,'']]], ['shape',['Shape',['../classyage_1_1Shape.html',1,'yage']]], @@ -21,15 +21,20 @@ var searchData= ['size_5f',['size_',['../classyage_1_1Collider.html#ad7456f84c1acb4fd9ee0ea67c8ee7308',1,'yage::Collider']]], ['skip',['skip',['../structstbi__io__callbacks.html#a864be557872041ac06e1509caf05cc83',1,'stbi_io_callbacks']]], ['slash',['SLASH',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a646da671ca01bb5d84dbb5fb2238dc8e',1,'yage']]], - ['space',['SPACE',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a6506ae39fdca9845e3a6de3865183e57',1,'yage']]], - ['sprite',['Sprite',['../classyage_1_1Sprite.html#a113bfddfa62846a1d8391d1b86de7987',1,'yage::Sprite::Sprite()=default'],['../classyage_1_1Sprite.html#aa5a7958e17f1d042226b91fb1829642e',1,'yage::Sprite::Sprite(const Sprite &)=delete'],['../classyage_1_1Sprite.html#a33789b3e37bfcb84ed89ec69f47817a1',1,'yage::Sprite::Sprite(Sprite &&)=delete'],['../classyage_1_1SpriteSheet.html#a2734c2e7b8bdfc9090d240c070ee55c0',1,'yage::SpriteSheet::sprite()']]], + ['space',['Space',['../classyage_1_1Space.html#a40c248478ae521bb4e0d5119002cf8e9',1,'yage::Space::Space()'],['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a6506ae39fdca9845e3a6de3865183e57',1,'yage::SPACE()']]], + ['space',['Space',['../classyage_1_1Space.html',1,'yage']]], + ['space_2ecpp',['space.cpp',['../space_8cpp.html',1,'']]], + ['space_2eh',['space.h',['../space_8h.html',1,'']]], ['sprite',['Sprite',['../classyage_1_1Sprite.html',1,'yage']]], + ['sprite',['Sprite',['../classyage_1_1Sprite.html#a113bfddfa62846a1d8391d1b86de7987',1,'yage::Sprite::Sprite()=default'],['../classyage_1_1Sprite.html#aa5a7958e17f1d042226b91fb1829642e',1,'yage::Sprite::Sprite(const Sprite &)=delete'],['../classyage_1_1Sprite.html#a33789b3e37bfcb84ed89ec69f47817a1',1,'yage::Sprite::Sprite(Sprite &&)=delete'],['../classyage_1_1SpriteSheet.html#a2734c2e7b8bdfc9090d240c070ee55c0',1,'yage::SpriteSheet::sprite()']]], ['sprite_2ecpp',['sprite.cpp',['../sprite_8cpp.html',1,'']]], ['sprite_2eh',['sprite.h',['../sprite_8h.html',1,'']]], ['spritebatch',['SpriteBatch',['../classyage_1_1SpriteBatch.html#afda50a8a2a6c9ffd1b9d962fae223f8a',1,'yage::SpriteBatch::SpriteBatch()'],['../classyage_1_1SpriteBatch.html#a30a46a7182235a739916d540781af652',1,'yage::SpriteBatch::SpriteBatch(const SpriteBatch &)=delete'],['../classyage_1_1SpriteBatch.html#a7f18a506f4188acd2219da8147dc0e1e',1,'yage::SpriteBatch::SpriteBatch(SpriteBatch &&)=delete']]], ['spritebatch',['SpriteBatch',['../classyage_1_1SpriteBatch.html',1,'yage']]], ['spritebatch_2ecpp',['spritebatch.cpp',['../spritebatch_8cpp.html',1,'']]], ['spritebatch_2eh',['spritebatch.h',['../spritebatch_8h.html',1,'']]], + ['spritebatch_2emd',['spritebatch.md',['../spritebatch_8md.html',1,'']]], + ['sprite_20batching',['Sprite Batching',['../spritebatch_guide.html',1,'']]], ['spritemap',['SpriteMap',['../namespaceyage_1_1details.html#a035f63ad1a3114ada8157ed4182521c9',1,'yage::details']]], ['spritesheet',['SpriteSheet',['../classyage_1_1SpriteSheet.html#a73db999ab17c4846f036eb47470176f6',1,'yage::SpriteSheet']]], ['spritesheet',['SpriteSheet',['../classyage_1_1SpriteSheet.html',1,'yage']]], @@ -84,8 +89,10 @@ var searchData= ['stbi_5fzlib_5fdecode_5fnoheader_5fmalloc',['stbi_zlib_decode_noheader_malloc',['../stb__image_8h.html#a7fbd65c83495f13f22469fe493775739',1,'stb_image.h']]], ['stbidef',['STBIDEF',['../stb__image_8h.html#a2d9ec9850cd12aefe7641b456266a4c2',1,'stb_image.h']]], ['swapbuffer',['swapBuffer',['../classyage_1_1Window.html#a86d0aa8e9896850b9acfc720b5615359',1,'yage::Window']]], - ['syncqueue',['SyncQueue',['../classyage_1_1SyncQueue.html#a0c8aa1c22e3e6d5094dbdeb88cff426b',1,'yage::SyncQueue::SyncQueue()=default'],['../classyage_1_1SyncQueue.html#a8f42b9b34c6495680aade2563cc2359c',1,'yage::SyncQueue::SyncQueue(const SyncQueue &)=delete']]], ['syncqueue',['SyncQueue',['../classyage_1_1SyncQueue.html',1,'yage']]], + ['syncqueue',['SyncQueue',['../classyage_1_1SyncQueue.html#a0c8aa1c22e3e6d5094dbdeb88cff426b',1,'yage::SyncQueue::SyncQueue()=default'],['../classyage_1_1SyncQueue.html#a8f42b9b34c6495680aade2563cc2359c',1,'yage::SyncQueue::SyncQueue(const SyncQueue &)=delete']]], ['syncqueue_2eh',['syncqueue.h',['../syncqueue_8h.html',1,'']]], - ['syncqueue_3c_20callback_20_3e',['SyncQueue< Callback >',['../classyage_1_1SyncQueue.html',1,'yage']]] + ['syncqueue_3c_20callback_20_3e',['SyncQueue< Callback >',['../classyage_1_1SyncQueue.html',1,'yage']]], + ['system',['System',['../classyage_1_1System.html',1,'yage']]], + ['system_2eh',['system.h',['../system_8h.html',1,'']]] ]; diff --git a/search/all_13.js b/search/all_13.js index 3356493e..d7c7fb17 100644 --- a/search/all_13.js +++ b/search/all_13.js @@ -10,7 +10,7 @@ var searchData= ['texturecache_2ecpp',['texturecache.cpp',['../texturecache_8cpp.html',1,'']]], ['texturecache_2eh',['texturecache.h',['../texturecache_8h.html',1,'']]], ['todo_20list',['Todo List',['../todo.html',1,'']]], - ['todolist_2edox',['todolist.dox',['../todolist_8dox.html',1,'']]], + ['todolist_2emd',['todolist.md',['../todolist_8md.html',1,'']]], ['top_5fleft',['top_left',['../structyage_1_1details_1_1Glyph.html#a4dd2989e7b2a6d58dea6c85a9a1ed80d',1,'yage::details::Glyph']]], ['top_5fright',['top_right',['../structyage_1_1details_1_1Glyph.html#a503ba9786cf0fe3535e968b607a001da',1,'yage::details::Glyph']]], ['tostring',['toString',['../classyage_1_1Matrix.html#a07678d7007e89487c7168df84f2a4fa8',1,'yage::Matrix::toString()'],['../classyage_1_1Vector.html#a956f7b6d02c0309adece311f59c8beae',1,'yage::Vector::toString()']]], diff --git a/search/all_14.js b/search/all_14.js index de79f614..ef0528c3 100644 --- a/search/all_14.js +++ b/search/all_14.js @@ -3,7 +3,7 @@ var searchData= ['u',['u',['../structyage_1_1UV.html#aa726c11ba59a9a5edffef27ac3845053',1,'yage::UV::u()'],['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a4c614360da93c0a041b22e537de151eb',1,'yage::U()']]], ['unknown',['UNKNOWN',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a696b031073e74bf2cb98e5ef201d4aa3',1,'yage']]], ['up',['UP',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822afbaedde498cdead4f2780217646e9ba1',1,'yage']]], - ['update',['update',['../classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c',1,'yage::Camera::update()'],['../classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36',1,'yage::Body::update()'],['../classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c',1,'yage::ParticleBody::update()']]], + ['update',['update',['../classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c',1,'yage::Camera::update()'],['../classyage_1_1Engine.html#a8d888a2871d93f40b98ecf3548dd8d67',1,'yage::Engine::update()'],['../classyage_1_1System.html#a882cfa13fc76d106c9d0ca68b17ff1ff',1,'yage::System::update()'],['../classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36',1,'yage::Body::update()'],['../classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c',1,'yage::ParticleBody::update()']]], ['use',['use',['../classyage_1_1Shader.html#a8cd66c177f148ac0b619766188696e6c',1,'yage::Shader']]], ['uv',['uv',['../structyage_1_1Vertex.html#a2d1923353f0e50e7753ff1ae2d9ba84e',1,'yage::Vertex::uv()'],['../structyage_1_1UV.html#ae236139f3a5f6024aac1e21bd93b7bde',1,'yage::UV::UV()=default'],['../structyage_1_1UV.html#ac918524789292937aae5803df3c2673f',1,'yage::UV::UV(float u_, float v_)']]], ['uv',['UV',['../structyage_1_1UV.html',1,'yage']]] diff --git a/search/all_18.js b/search/all_18.js index 35ffa9f5..81a6f12a 100644 --- a/search/all_18.js +++ b/search/all_18.js @@ -3,6 +3,7 @@ var searchData= ['details',['details',['../namespaceyage_1_1details.html',1,'yage']]], ['yage',['YAGE',['../index.html',1,'']]], ['matrix',['matrix',['../namespaceyage_1_1matrix.html',1,'yage']]], + ['yage',['YAGE',['../md_README.html',1,'']]], ['y',['y',['../structyage_1_1details_1_1Coordinate.html#a6d54c056ec7bd3c7ed1c6a226c2cf508',1,'yage::details::Coordinate::y()'],['../structyage_1_1Texture.html#a4bfae86da1ef1930238291660223a8f0',1,'yage::Texture::y()'],['../structyage_1_1Position.html#a45b8cc8245d0e05bb9e482d85512ee27',1,'yage::Position::y()'],['../classyage_1_1Vector3.html#a3076edb39227c1fcc77a8160fb9c5832',1,'yage::Vector3::y()'],['../classyage_1_1Vector4.html#ae0609f2db5e14fe05fddd71ec09f4735',1,'yage::Vector4::y()'],['../classyage_1_1Vector2.html#a554645b415a76af47698985b7757f0c2',1,'yage::Vector2::y()'],['../classyage_1_1Vector2.html#a216ac57d39572b46ab8307a7728e4456',1,'yage::Vector2::y() const '],['../classyage_1_1Vector3.html#a9b984c33ac0a7d7ade6963baea0e5ee8',1,'yage::Vector3::y()'],['../classyage_1_1Vector4.html#a0c7bf86ba48c9bda10e0605441bb8c3c',1,'yage::Vector4::y()'],['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a57cec4137b614c87cb4e24a3d003a3e0',1,'yage::Y()']]], ['yage',['yage',['../namespaceyage.html',1,'']]], ['yage_2ecpp',['yage.cpp',['../yage_8cpp.html',1,'']]], diff --git a/search/all_1a.js b/search/all_1a.js index 4a39058c..650b6532 100644 --- a/search/all_1a.js +++ b/search/all_1a.js @@ -6,5 +6,6 @@ var searchData= ['_7eshader',['~Shader',['../classyage_1_1Shader.html#a9307c4f3cfaf5e584b70601294e09bdd',1,'yage::Shader']]], ['_7esprite',['~Sprite',['../classyage_1_1Sprite.html#aa2f833e040940616fa17ee8f02f8cab2',1,'yage::Sprite']]], ['_7espritebatch',['~SpriteBatch',['../classyage_1_1SpriteBatch.html#afa26d86730be23aa5e0c8c4a9d67001a',1,'yage::SpriteBatch']]], + ['_7esystem',['~System',['../classyage_1_1System.html#a32e00cf7f9b517a43e7db16d2aaa9b57',1,'yage::System']]], ['_7ewindow',['~Window',['../classyage_1_1Window.html#a9a8dd109e145c459e52abb3a8861e3a0',1,'yage::Window']]] ]; diff --git a/search/all_2.js b/search/all_2.js index b2866051..e9d50262 100644 --- a/search/all_2.js +++ b/search/all_2.js @@ -17,10 +17,15 @@ var searchData= ['collisionbody',['CollisionBody',['../classyage_1_1CollisionBody.html',1,'yage']]], ['collisionbody_2eh',['collisionbody.h',['../collisionbody_8h.html',1,'']]], ['colour',['Colour',['../structyage_1_1Colour.html',1,'yage']]], - ['colour',['colour',['../structyage_1_1Vertex.html#a142db28be39f418a06fa43f75d386182',1,'yage::Vertex::colour()'],['../structyage_1_1Colour.html#a585165d5109c81b6b2de6f1116406abd',1,'yage::Colour::Colour()'],['../structyage_1_1Colour.html#a8118ad802db7e61df770f7d3b5b88aaa',1,'yage::Colour::Colour(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)']]], + ['colour',['Colour',['../structyage_1_1Colour.html#a585165d5109c81b6b2de6f1116406abd',1,'yage::Colour::Colour()'],['../structyage_1_1Colour.html#a8118ad802db7e61df770f7d3b5b88aaa',1,'yage::Colour::Colour(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)'],['../structyage_1_1Vertex.html#a142db28be39f418a06fa43f75d386182',1,'yage::Vertex::colour()']]], ['colsize',['colSize',['../classyage_1_1Matrix.html#a2148cd52008892765ad90250c68afba1',1,'yage::Matrix']]], ['comma',['COMMA',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a4d9b3e9fc12849d060371eb65154c751',1,'yage']]], - ['coordinate',['Coordinate',['../structyage_1_1details_1_1Coordinate.html#a0b3a6d9aa1d5b846ad7ebc11bc77c629',1,'yage::details::Coordinate::Coordinate()=default'],['../structyage_1_1details_1_1Coordinate.html#a43fb6bd3e325d5cd7ec436778605db2a',1,'yage::details::Coordinate::Coordinate(int x_i, int y_i, int width_i, int height_i)']]], + ['component',['Component',['../classComponent.html',1,'']]], + ['component_2eh',['component.h',['../component_8h.html',1,'']]], + ['componentenum',['ComponentEnum',['../component_8h.html#a265b76591becf42b342804bbc4a79507',1,'component.h']]], ['coordinate',['Coordinate',['../structyage_1_1details_1_1Coordinate.html',1,'yage::details']]], - ['create',['create',['../classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745',1,'yage::Window::create()'],['../classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064',1,'yage::Active::create()']]] + ['coordinate',['Coordinate',['../structyage_1_1details_1_1Coordinate.html#a0b3a6d9aa1d5b846ad7ebc11bc77c629',1,'yage::details::Coordinate::Coordinate()=default'],['../structyage_1_1details_1_1Coordinate.html#a43fb6bd3e325d5cd7ec436778605db2a',1,'yage::details::Coordinate::Coordinate(int x_i, int y_i, int width_i, int height_i)']]], + ['create',['create',['../classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745',1,'yage::Window::create()'],['../classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064',1,'yage::Active::create()']]], + ['createentity',['createEntity',['../classyage_1_1EntityManager.html#acdd054a1235fb03452089d9f419a7e2b',1,'yage::EntityManager::createEntity()'],['../classyage_1_1Space.html#a41bc332ffb3042c0872ede8c53ff1fa4',1,'yage::Space::createEntity()']]], + ['createentityinstance',['createEntityInstance',['../classyage_1_1EntityManager.html#a188f3bc252781f9f3a7b4da417f0d7de',1,'yage::EntityManager']]] ]; diff --git a/search/all_4.js b/search/all_4.js index 42a1767c..04efa775 100644 --- a/search/all_4.js +++ b/search/all_4.js @@ -3,7 +3,18 @@ var searchData= ['e',['E',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a3a3ea00cfc35332cedf6e5e9a32e94da',1,'yage']]], ['ellipse_2eh',['ellipse.h',['../ellipse_8h.html',1,'']]], ['end',['end',['../classyage_1_1Matrix.html#a20ea5fe16d27ef15f775b5497cadc851',1,'yage::Matrix::end()'],['../classyage_1_1Batch.html#a322b0fe531c9cfa506d6d2dd786a236e',1,'yage::Batch::end()'],['../classyage_1_1SpriteBatch.html#af8b705cdad7ceefa902f3be620ac8632',1,'yage::SpriteBatch::end()'],['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822ab1a326c06d88bf042f73d70f50197905',1,'yage::END()']]], + ['engine',['Engine',['../classyage_1_1Engine.html',1,'yage']]], + ['engine_2ecpp',['engine.cpp',['../engine_8cpp.html',1,'']]], + ['engine_2eh',['engine.h',['../engine_8h.html',1,'']]], ['enter',['ENTER',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a331b3100a485d8cacff1d3df8e9b0c13',1,'yage']]], + ['entity',['Entity',['../classyage_1_1Entity.html',1,'yage']]], + ['entity',['Entity',['../classyage_1_1Entity.html#a046099f19b3483140505938769276d8a',1,'yage::Entity']]], + ['entity_2ecpp',['entity.cpp',['../entity_8cpp.html',1,'']]], + ['entity_2eh',['entity.h',['../entity_8h.html',1,'']]], + ['entitymanager',['EntityManager',['../classyage_1_1EntityManager.html#a255fa9aff3e6b208eea0c38d8caf08f8',1,'yage::EntityManager::EntityManager()=default'],['../classyage_1_1EntityManager.html#a0099fe0038967007891d2b7575090915',1,'yage::EntityManager::EntityManager(Space *space)'],['../classyage_1_1EntityManager.html#af1644095d96e43ac000375ba7f7ee021',1,'yage::EntityManager::EntityManager(Space *space, std::size_t n)']]], + ['entitymanager',['EntityManager',['../classyage_1_1EntityManager.html',1,'yage']]], + ['entitymanager_2ecpp',['entitymanager.cpp',['../entitymanager_8cpp.html',1,'']]], + ['entitymanager_2eh',['entitymanager.h',['../entitymanager_8h.html',1,'']]], ['eof',['eof',['../structstbi__io__callbacks.html#a2c4f3c3b7c75a2e74a35caf74fb8d177',1,'stbi_io_callbacks']]], ['equal',['EQUAL',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a969f331a87d8c958473c32b4d0e61a44',1,'yage']]], ['error',['ERROR',['../namespaceyage.html#a4ac616fa26af17775ed558a4c08e4788abb1ca97ec761fc37101737ba0aa2e7c5',1,'yage']]], diff --git a/search/all_6.js b/search/all_6.js index 9c37fbe7..0b5793c3 100644 --- a/search/all_6.js +++ b/search/all_6.js @@ -2,13 +2,14 @@ var searchData= [ ['g',['g',['../structyage_1_1Colour.html#a205d3a63268f4879adf27aabdf71a6dd',1,'yage::Colour::g()'],['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822adfcf28d0734569a6a693bc8194de62bf',1,'yage::G()']]], ['getcol',['getCol',['../classyage_1_1Matrix.html#a74475218328d6ef69701a6e261df925b',1,'yage::Matrix']]], + ['gethandle',['getHandle',['../classyage_1_1Entity.html#adb9e45f096a38c1057bba28acf7dde71',1,'yage::Entity']]], ['getrow',['getRow',['../classyage_1_1Matrix.html#a960273d1ac46a8edb71ceee08ee639b8',1,'yage::Matrix']]], ['gettexture',['getTexture',['../classyage_1_1ResourceManager.html#aec533f266d9b432050faed301f4191dc',1,'yage::ResourceManager::getTexture()'],['../classyage_1_1TextureCache.html#ad4929640230f9a74fcd634416fe0974f',1,'yage::TextureCache::getTexture()']]], ['gettexturefromspritesheet',['getTextureFromSpriteSheet',['../classyage_1_1TextureCache.html#abb785ce35eb847c02de67dc9e6e06bcd',1,'yage::TextureCache']]], ['glfw_5finclude_5fnone',['GLFW_INCLUDE_NONE',['../input_8h.html#a088324ad8995e3eb76024e3e79083d48',1,'input.h']]], - ['glfwerrorcallback',['glfwErrorCallback',['../namespaceyage.html#a0bd2fedcbe862fdea1ea54b6b7d49bec',1,'yage']]], - ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html',1,'yage::details']]], + ['glfwerrorcallback',['glfwErrorCallback',['../namespaceyage.html#ae53246342d5b0371f300336cbc6595a3',1,'yage']]], ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html#a91752b58fc10fb037658f27c9338627c',1,'yage::details::Glyph']]], + ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html',1,'yage::details']]], ['grave_5faccent',['GRAVE_ACCENT',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a1547ad05c44be2cc614be32159bf666b',1,'yage']]], ['gravity',['GRAVITY',['../classyage_1_1Body.html#a4f61913cf00244a6160e09cda846f766',1,'yage::Body']]], ['gravity_5f',['gravity_',['../classyage_1_1Body.html#a454a7c59d07c94afb0a35c3d53ec2191',1,'yage::Body']]] diff --git a/search/all_8.js b/search/all_8.js index eb720a18..0546b201 100644 --- a/search/all_8.js +++ b/search/all_8.js @@ -6,11 +6,11 @@ var searchData= ['imageloader_2ecpp',['imageloader.cpp',['../imageloader_8cpp.html',1,'']]], ['imageloader_2eh',['imageloader.h',['../imageloader_8h.html',1,'']]], ['info',['INFO',['../namespaceyage.html#a4ac616fa26af17775ed558a4c08e4788a551b723eafd6a31d444fcb2f5920fbd3',1,'yage']]], - ['init',['init',['../classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477',1,'yage::Batch::init()'],['../classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1',1,'yage::Sprite::init()'],['../namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce',1,'yage::init()']]], + ['init',['init',['../classyage_1_1Engine.html#a41073d8b8117e567357fe46fed01bbe4',1,'yage::Engine::init()'],['../classyage_1_1System.html#ad697e043fcf7dbcf77821f49073f5af9',1,'yage::System::init()'],['../classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477',1,'yage::Batch::init()'],['../classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1',1,'yage::Sprite::init()'],['../namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce',1,'yage::init()']]], ['input_2eh',['input.h',['../input_8h.html',1,'']]], ['insert',['INSERT',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a61ee777e7f71dc466c3b2c685d8d313b',1,'yage']]], ['inside',['inside',['../classyage_1_1Collider.html#a4a8ad9e664a0015e023a70d196302fe9',1,'yage::Collider::inside()'],['../classyage_1_1RectangleCollider.html#ac8d8e6bdb12c21be12f7d398242147c4',1,'yage::RectangleCollider::inside()']]], - ['instance',['instance',['../classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e',1,'yage::Logger']]], + ['instance',['instance',['../classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e',1,'yage::Logger::instance()'],['../classyage_1_1Engine.html#a7e4303fa3bd951ee64e166d6e0fb7b33',1,'yage::Engine::instance()']]], ['iomanager',['IoManager',['../classyage_1_1IoManager.html',1,'yage']]], ['iomanager_2ecpp',['iomanager.cpp',['../iomanager_8cpp.html',1,'']]], ['iomanager_2eh',['iomanager.h',['../iomanager_8h.html',1,'']]] diff --git a/search/all_b.js b/search/all_b.js index 5bc41c42..7b493842 100644 --- a/search/all_b.js +++ b/search/all_b.js @@ -14,8 +14,9 @@ var searchData= ['logger',['Logger',['../classyage_1_1Logger.html',1,'yage']]], ['logger',['Logger',['../classyage_1_1LogMessage.html#aff02b76416d2846736b7ecd798921a0a',1,'yage::LogMessage::Logger()'],['../classyage_1_1Logger.html#a950c0c75b86bf330cf11a0ad29bd9a64',1,'yage::Logger::Logger()'],['../classyage_1_1Logger.html#a3d54590303257e9a8d1da26d59571352',1,'yage::Logger::Logger(const std::string &file_path)'],['../classyage_1_1Logger.html#a71f6ab0fa1e86d790553c0763a255b2b',1,'yage::Logger::Logger(LogLevel min_level)'],['../classyage_1_1Logger.html#acbd21a2da8b423e9f606c386cabac074',1,'yage::Logger::Logger(LogLevel min_level, const std::string &file_path)']]], ['logger_2ecpp',['logger.cpp',['../logger_8cpp.html',1,'']]], - ['logger_2edox',['logger.dox',['../logger_8dox.html',1,'']]], ['logger_2eh',['logger.h',['../logger_8h.html',1,'']]], + ['logger_2emd',['logger.md',['../logger_8md.html',1,'']]], + ['logger',['Logger',['../logger_guide.html',1,'']]], ['loglevel',['LogLevel',['../namespaceyage.html#a4ac616fa26af17775ed558a4c08e4788',1,'yage']]], ['loglevel_2eh',['loglevel.h',['../loglevel_8h.html',1,'']]], ['logmessage',['LogMessage',['../classyage_1_1LogMessage.html#af4ab2630201ecd155c329fbfebe352be',1,'yage::LogMessage']]], diff --git a/search/all_c.js b/search/all_c.js index 1ad1f18a..b417edd6 100644 --- a/search/all_c.js +++ b/search/all_c.js @@ -1,15 +1,18 @@ var searchData= [ ['m',['M',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a69691c7bdcc3ce6d5d8a1361f22d04ac',1,'yage']]], + ['main_2emd',['main.md',['../main_8md.html',1,'']]], + ['mainloop',['mainLoop',['../classyage_1_1Engine.html#a245478397be4ca0d9ac6af84c1753e42',1,'yage::Engine']]], ['makeconsolesink',['makeConsoleSink',['../namespaceyage.html#ab54350a8dbf59338c99ab4f43cfa2858',1,'yage']]], ['makefilesink',['makeFileSink',['../namespaceyage.html#ad537beeea51c8314e407fadd24affc34',1,'yage::makeFileSink(const std::string &filename)'],['../namespaceyage.html#a6b288197f6a97f197dda60e5b54f1841',1,'yage::makeFileSink(std::string &&filename)']]], ['mass_5f',['mass_',['../classyage_1_1Body.html#a01b2a500e71bc88f2cb597f376bc8289',1,'yage::Body']]], - ['matrix',['Matrix',['../classyage_1_1Matrix.html#a73b7d1f94f4f72a2294b71b3a35794ad',1,'yage::Matrix::Matrix()'],['../classyage_1_1Matrix.html#a191b02ff353d04f18779d4c84e20927b',1,'yage::Matrix::Matrix(const std::vector< Type > &data)']]], ['matrix',['Matrix',['../classyage_1_1Matrix.html',1,'yage']]], - ['matrix_2edox',['matrix.dox',['../matrix_8dox.html',1,'']]], + ['matrix',['Matrix',['../classyage_1_1Matrix.html#a73b7d1f94f4f72a2294b71b3a35794ad',1,'yage::Matrix::Matrix()'],['../classyage_1_1Matrix.html#a191b02ff353d04f18779d4c84e20927b',1,'yage::Matrix::Matrix(const std::vector< Type > &data)']]], ['matrix_2eh',['matrix.h',['../matrix_8h.html',1,'']]], + ['matrix_2emd',['matrix.md',['../matrix_8md.html',1,'']]], ['matrix_3c_20rows_2c_201_2c_20double_20_3e',['Matrix< Rows, 1, double >',['../classyage_1_1Matrix.html',1,'yage']]], ['matrix_3c_20rows_2c_201_2c_20type_20_3e',['Matrix< Rows, 1, Type >',['../classyage_1_1Matrix.html',1,'yage']]], + ['matrix_20guide',['Matrix Guide',['../matrix_guide.html',1,'']]], ['menu',['MENU',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a3ed53fbeb1eab0443561b68ca0c0b5cf',1,'yage']]], ['meta',['Meta',['../structyage_1_1LogMessage_1_1Meta.html',1,'yage::LogMessage']]], ['minus',['MINUS',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822affc0d9b54a1fe677c4c9e6b050e67c81',1,'yage']]], diff --git a/search/all_d.js b/search/all_d.js index 92dd4330..99de2295 100644 --- a/search/all_d.js +++ b/search/all_d.js @@ -1,6 +1,7 @@ var searchData= [ ['n',['N',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a8d9c307cb7f3c4a32822a51922d1ceaa',1,'yage']]], + ['nax_5fcomponents',['NAX_COMPONENTS',['../component_8h.html#a265b76591becf42b342804bbc4a79507af13334a5251126fb6c2316d8c81c5419',1,'component.h']]], ['num0',['NUM0',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a22517dfceb401f35b1b59999ba74c700',1,'yage']]], ['num1',['NUM1',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a71ddb986230a88155bf74e65f644dda4',1,'yage']]], ['num2',['NUM2',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a78232351eaf00755d136afad0745157b',1,'yage']]], diff --git a/search/all_f.js b/search/all_f.js index 9c3640aa..0bde2e41 100644 --- a/search/all_f.js +++ b/search/all_f.js @@ -13,7 +13,7 @@ var searchData= ['physics_2eh',['physics.h',['../physics_8h.html',1,'']]], ['pollevents',['pollEvents',['../classyage_1_1Window.html#a1a311e27b1e588f0fce540ce040dcbd5',1,'yage::Window']]], ['pop',['pop',['../classyage_1_1SyncQueue.html#a1f7f099e1347b82c1f2b72a5352ca05e',1,'yage::SyncQueue::pop()'],['../classyage_1_1SyncQueue.html#ab8a3c646e1d2f9adfcbcfbaa2e2a4b27',1,'yage::SyncQueue::pop(T &item)']]], - ['position',['position',['../structyage_1_1Vertex.html#abefe88d26b055655f9cc038a1dd4ff6a',1,'yage::Vertex::position()'],['../structyage_1_1Position.html#a41b1d5ee23c50208982ab6089708e5d2',1,'yage::Position::Position()=default'],['../structyage_1_1Position.html#aaeaa1cd93e57adcb08ef4f76513148e2',1,'yage::Position::Position(float x_, float y_)']]], + ['position',['Position',['../structyage_1_1Position.html#a41b1d5ee23c50208982ab6089708e5d2',1,'yage::Position::Position()=default'],['../structyage_1_1Position.html#aaeaa1cd93e57adcb08ef4f76513148e2',1,'yage::Position::Position(float x_, float y_)'],['../structyage_1_1Vertex.html#abefe88d26b055655f9cc038a1dd4ff6a',1,'yage::Vertex::position()'],['../component_8h.html#a265b76591becf42b342804bbc4a79507a90b4ba73224408e82ade8a072a3712c1',1,'POSITION(): component.h']]], ['position',['Position',['../structyage_1_1Position.html',1,'yage']]], ['position_5f',['position_',['../classyage_1_1Body.html#a8fe4f244be47f1336a57c1f2aa095157',1,'yage::Body::position_()'],['../classyage_1_1Collider.html#a2ae348a82a0ca7a871c05f36e5031161',1,'yage::Collider::position_()']]], ['print_5fscreen',['PRINT_SCREEN',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a853f8ded7a96b5a765704974e6a3ca96',1,'yage']]], diff --git a/search/classes_2.js b/search/classes_2.js index 39c1012f..27ed82b5 100644 --- a/search/classes_2.js +++ b/search/classes_2.js @@ -4,5 +4,6 @@ var searchData= ['collider',['Collider',['../classyage_1_1Collider.html',1,'yage']]], ['collisionbody',['CollisionBody',['../classyage_1_1CollisionBody.html',1,'yage']]], ['colour',['Colour',['../structyage_1_1Colour.html',1,'yage']]], + ['component',['Component',['../classComponent.html',1,'']]], ['coordinate',['Coordinate',['../structyage_1_1details_1_1Coordinate.html',1,'yage::details']]] ]; diff --git a/search/classes_4.js b/search/classes_4.js index 4316901e..6da61229 100644 --- a/search/classes_4.js +++ b/search/classes_4.js @@ -1,4 +1,6 @@ var searchData= [ - ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html',1,'yage::details']]] + ['engine',['Engine',['../classyage_1_1Engine.html',1,'yage']]], + ['entity',['Entity',['../classyage_1_1Entity.html',1,'yage']]], + ['entitymanager',['EntityManager',['../classyage_1_1EntityManager.html',1,'yage']]] ]; diff --git a/search/classes_5.js b/search/classes_5.js index 31f6033f..4316901e 100644 --- a/search/classes_5.js +++ b/search/classes_5.js @@ -1,5 +1,4 @@ var searchData= [ - ['imageloader',['ImageLoader',['../classyage_1_1ImageLoader.html',1,'yage']]], - ['iomanager',['IoManager',['../classyage_1_1IoManager.html',1,'yage']]] + ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html',1,'yage::details']]] ]; diff --git a/search/classes_6.js b/search/classes_6.js index f1ddc024..31f6033f 100644 --- a/search/classes_6.js +++ b/search/classes_6.js @@ -1,6 +1,5 @@ var searchData= [ - ['logger',['Logger',['../classyage_1_1Logger.html',1,'yage']]], - ['logmessage',['LogMessage',['../classyage_1_1LogMessage.html',1,'yage']]], - ['logsink',['LogSink',['../classyage_1_1LogSink.html',1,'yage']]] + ['imageloader',['ImageLoader',['../classyage_1_1ImageLoader.html',1,'yage']]], + ['iomanager',['IoManager',['../classyage_1_1IoManager.html',1,'yage']]] ]; diff --git a/search/classes_7.js b/search/classes_7.js index 5c0e52cf..f1ddc024 100644 --- a/search/classes_7.js +++ b/search/classes_7.js @@ -1,7 +1,6 @@ var searchData= [ - ['matrix',['Matrix',['../classyage_1_1Matrix.html',1,'yage']]], - ['matrix_3c_20rows_2c_201_2c_20double_20_3e',['Matrix< Rows, 1, double >',['../classyage_1_1Matrix.html',1,'yage']]], - ['matrix_3c_20rows_2c_201_2c_20type_20_3e',['Matrix< Rows, 1, Type >',['../classyage_1_1Matrix.html',1,'yage']]], - ['meta',['Meta',['../structyage_1_1LogMessage_1_1Meta.html',1,'yage::LogMessage']]] + ['logger',['Logger',['../classyage_1_1Logger.html',1,'yage']]], + ['logmessage',['LogMessage',['../classyage_1_1LogMessage.html',1,'yage']]], + ['logsink',['LogSink',['../classyage_1_1LogSink.html',1,'yage']]] ]; diff --git a/search/classes_8.js b/search/classes_8.js index d616947f..5c0e52cf 100644 --- a/search/classes_8.js +++ b/search/classes_8.js @@ -1,5 +1,7 @@ var searchData= [ - ['particlebody',['ParticleBody',['../classyage_1_1ParticleBody.html',1,'yage']]], - ['position',['Position',['../structyage_1_1Position.html',1,'yage']]] + ['matrix',['Matrix',['../classyage_1_1Matrix.html',1,'yage']]], + ['matrix_3c_20rows_2c_201_2c_20double_20_3e',['Matrix< Rows, 1, double >',['../classyage_1_1Matrix.html',1,'yage']]], + ['matrix_3c_20rows_2c_201_2c_20type_20_3e',['Matrix< Rows, 1, Type >',['../classyage_1_1Matrix.html',1,'yage']]], + ['meta',['Meta',['../structyage_1_1LogMessage_1_1Meta.html',1,'yage::LogMessage']]] ]; diff --git a/search/classes_9.js b/search/classes_9.js index 5c9a6968..d616947f 100644 --- a/search/classes_9.js +++ b/search/classes_9.js @@ -1,9 +1,5 @@ var searchData= [ - ['rectangle',['Rectangle',['../classyage_1_1Rectangle.html',1,'yage']]], - ['rectanglecollider',['RectangleCollider',['../classyage_1_1RectangleCollider.html',1,'yage']]], - ['renderbatch',['RenderBatch',['../structyage_1_1details_1_1RenderBatch.html',1,'yage::details']]], - ['resourcemanager',['ResourceManager',['../classyage_1_1ResourceManager.html',1,'yage']]], - ['rigidbody',['RigidBody',['../classyage_1_1RigidBody.html',1,'yage']]], - ['row',['Row',['../classyage_1_1details_1_1Row.html',1,'yage::details']]] + ['particlebody',['ParticleBody',['../classyage_1_1ParticleBody.html',1,'yage']]], + ['position',['Position',['../structyage_1_1Position.html',1,'yage']]] ]; diff --git a/search/classes_a.js b/search/classes_a.js index 8ff19f3c..5c9a6968 100644 --- a/search/classes_a.js +++ b/search/classes_a.js @@ -1,11 +1,9 @@ var searchData= [ - ['shader',['Shader',['../classyage_1_1Shader.html',1,'yage']]], - ['shape',['Shape',['../classyage_1_1Shape.html',1,'yage']]], - ['sprite',['Sprite',['../classyage_1_1Sprite.html',1,'yage']]], - ['spritebatch',['SpriteBatch',['../classyage_1_1SpriteBatch.html',1,'yage']]], - ['spritesheet',['SpriteSheet',['../classyage_1_1SpriteSheet.html',1,'yage']]], - ['stbi_5fio_5fcallbacks',['stbi_io_callbacks',['../structstbi__io__callbacks.html',1,'']]], - ['syncqueue',['SyncQueue',['../classyage_1_1SyncQueue.html',1,'yage']]], - ['syncqueue_3c_20callback_20_3e',['SyncQueue< Callback >',['../classyage_1_1SyncQueue.html',1,'yage']]] + ['rectangle',['Rectangle',['../classyage_1_1Rectangle.html',1,'yage']]], + ['rectanglecollider',['RectangleCollider',['../classyage_1_1RectangleCollider.html',1,'yage']]], + ['renderbatch',['RenderBatch',['../structyage_1_1details_1_1RenderBatch.html',1,'yage::details']]], + ['resourcemanager',['ResourceManager',['../classyage_1_1ResourceManager.html',1,'yage']]], + ['rigidbody',['RigidBody',['../classyage_1_1RigidBody.html',1,'yage']]], + ['row',['Row',['../classyage_1_1details_1_1Row.html',1,'yage::details']]] ]; diff --git a/search/classes_b.js b/search/classes_b.js index bb215bc2..b02501e0 100644 --- a/search/classes_b.js +++ b/search/classes_b.js @@ -1,5 +1,13 @@ var searchData= [ - ['texture',['Texture',['../structyage_1_1Texture.html',1,'yage']]], - ['texturecache',['TextureCache',['../classyage_1_1TextureCache.html',1,'yage']]] + ['shader',['Shader',['../classyage_1_1Shader.html',1,'yage']]], + ['shape',['Shape',['../classyage_1_1Shape.html',1,'yage']]], + ['space',['Space',['../classyage_1_1Space.html',1,'yage']]], + ['sprite',['Sprite',['../classyage_1_1Sprite.html',1,'yage']]], + ['spritebatch',['SpriteBatch',['../classyage_1_1SpriteBatch.html',1,'yage']]], + ['spritesheet',['SpriteSheet',['../classyage_1_1SpriteSheet.html',1,'yage']]], + ['stbi_5fio_5fcallbacks',['stbi_io_callbacks',['../structstbi__io__callbacks.html',1,'']]], + ['syncqueue',['SyncQueue',['../classyage_1_1SyncQueue.html',1,'yage']]], + ['syncqueue_3c_20callback_20_3e',['SyncQueue< Callback >',['../classyage_1_1SyncQueue.html',1,'yage']]], + ['system',['System',['../classyage_1_1System.html',1,'yage']]] ]; diff --git a/search/classes_c.js b/search/classes_c.js index 92c686bb..bb215bc2 100644 --- a/search/classes_c.js +++ b/search/classes_c.js @@ -1,4 +1,5 @@ var searchData= [ - ['uv',['UV',['../structyage_1_1UV.html',1,'yage']]] + ['texture',['Texture',['../structyage_1_1Texture.html',1,'yage']]], + ['texturecache',['TextureCache',['../classyage_1_1TextureCache.html',1,'yage']]] ]; diff --git a/search/classes_d.js b/search/classes_d.js index d084cf51..92c686bb 100644 --- a/search/classes_d.js +++ b/search/classes_d.js @@ -1,13 +1,4 @@ var searchData= [ - ['vector',['Vector',['../classyage_1_1Vector.html',1,'yage']]], - ['vector2',['Vector2',['../classyage_1_1Vector2.html',1,'yage']]], - ['vector2_3c_20double_20_3e',['Vector2< double >',['../classyage_1_1Vector2.html',1,'yage']]], - ['vector3',['Vector3',['../classyage_1_1Vector3.html',1,'yage']]], - ['vector4',['Vector4',['../classyage_1_1Vector4.html',1,'yage']]], - ['vector_3c_202_2c_20double_20_3e',['Vector< 2, double >',['../classyage_1_1Vector.html',1,'yage']]], - ['vector_3c_202_2c_20type_20_3e',['Vector< 2, Type >',['../classyage_1_1Vector.html',1,'yage']]], - ['vector_3c_203_2c_20type_20_3e',['Vector< 3, Type >',['../classyage_1_1Vector.html',1,'yage']]], - ['vector_3c_204_2c_20type_20_3e',['Vector< 4, Type >',['../classyage_1_1Vector.html',1,'yage']]], - ['vertex',['Vertex',['../structyage_1_1Vertex.html',1,'yage']]] + ['uv',['UV',['../structyage_1_1UV.html',1,'yage']]] ]; diff --git a/search/classes_e.js b/search/classes_e.js index 50e8b3e6..d084cf51 100644 --- a/search/classes_e.js +++ b/search/classes_e.js @@ -1,4 +1,13 @@ var searchData= [ - ['window',['Window',['../classyage_1_1Window.html',1,'yage']]] + ['vector',['Vector',['../classyage_1_1Vector.html',1,'yage']]], + ['vector2',['Vector2',['../classyage_1_1Vector2.html',1,'yage']]], + ['vector2_3c_20double_20_3e',['Vector2< double >',['../classyage_1_1Vector2.html',1,'yage']]], + ['vector3',['Vector3',['../classyage_1_1Vector3.html',1,'yage']]], + ['vector4',['Vector4',['../classyage_1_1Vector4.html',1,'yage']]], + ['vector_3c_202_2c_20double_20_3e',['Vector< 2, double >',['../classyage_1_1Vector.html',1,'yage']]], + ['vector_3c_202_2c_20type_20_3e',['Vector< 2, Type >',['../classyage_1_1Vector.html',1,'yage']]], + ['vector_3c_203_2c_20type_20_3e',['Vector< 3, Type >',['../classyage_1_1Vector.html',1,'yage']]], + ['vector_3c_204_2c_20type_20_3e',['Vector< 4, Type >',['../classyage_1_1Vector.html',1,'yage']]], + ['vertex',['Vertex',['../structyage_1_1Vertex.html',1,'yage']]] ]; diff --git a/search/classes_f.html b/search/classes_f.html new file mode 100644 index 00000000..cee523ad --- /dev/null +++ b/search/classes_f.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/classes_f.js b/search/classes_f.js new file mode 100644 index 00000000..50e8b3e6 --- /dev/null +++ b/search/classes_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['window',['Window',['../classyage_1_1Window.html',1,'yage']]] +]; diff --git a/search/enums_0.js b/search/enums_0.js index a86b6476..bba27f5e 100644 --- a/search/enums_0.js +++ b/search/enums_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['key',['key',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822',1,'yage']]] + ['componentenum',['ComponentEnum',['../component_8h.html#a265b76591becf42b342804bbc4a79507',1,'component.h']]] ]; diff --git a/search/enums_1.js b/search/enums_1.js index c289225e..a86b6476 100644 --- a/search/enums_1.js +++ b/search/enums_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['loglevel',['LogLevel',['../namespaceyage.html#a4ac616fa26af17775ed558a4c08e4788',1,'yage']]] + ['key',['key',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822',1,'yage']]] ]; diff --git a/search/enums_2.js b/search/enums_2.js index 59289f8c..c289225e 100644 --- a/search/enums_2.js +++ b/search/enums_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['windowflags',['WindowFlags',['../namespaceyage.html#a09d41deeced5fca5df9dc680c9e77c38',1,'yage']]] + ['loglevel',['LogLevel',['../namespaceyage.html#a4ac616fa26af17775ed558a4c08e4788',1,'yage']]] ]; diff --git a/search/enums_3.html b/search/enums_3.html new file mode 100644 index 00000000..77df324a --- /dev/null +++ b/search/enums_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/enums_3.js b/search/enums_3.js new file mode 100644 index 00000000..59289f8c --- /dev/null +++ b/search/enums_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['windowflags',['WindowFlags',['../namespaceyage.html#a09d41deeced5fca5df9dc680c9e77c38',1,'yage']]] +]; diff --git a/search/enumvalues_d.js b/search/enumvalues_d.js index 0cd479d6..6f23646c 100644 --- a/search/enumvalues_d.js +++ b/search/enumvalues_d.js @@ -1,6 +1,7 @@ var searchData= [ ['n',['N',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a8d9c307cb7f3c4a32822a51922d1ceaa',1,'yage']]], + ['nax_5fcomponents',['NAX_COMPONENTS',['../component_8h.html#a265b76591becf42b342804bbc4a79507af13334a5251126fb6c2316d8c81c5419',1,'component.h']]], ['num0',['NUM0',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a22517dfceb401f35b1b59999ba74c700',1,'yage']]], ['num1',['NUM1',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a71ddb986230a88155bf74e65f644dda4',1,'yage']]], ['num2',['NUM2',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a78232351eaf00755d136afad0745157b',1,'yage']]], diff --git a/search/enumvalues_f.js b/search/enumvalues_f.js index 1066662e..17c586db 100644 --- a/search/enumvalues_f.js +++ b/search/enumvalues_f.js @@ -5,5 +5,6 @@ var searchData= ['page_5fup',['PAGE_UP',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822ae791d936f894ce58dd18bf603edcb9b4',1,'yage']]], ['pause',['PAUSE',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a291554596c183e837f0a6bec3767c891',1,'yage']]], ['period',['PERIOD',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822ade58a28573783fe95304a260ccd90362',1,'yage']]], + ['position',['POSITION',['../component_8h.html#a265b76591becf42b342804bbc4a79507a90b4ba73224408e82ade8a072a3712c1',1,'component.h']]], ['print_5fscreen',['PRINT_SCREEN',['../namespaceyage.html#ad5a9307442e5daa8810aff942564a822a853f8ded7a96b5a765704974e6a3ca96',1,'yage']]] ]; diff --git a/search/files_2.js b/search/files_2.js index 202c9f20..6a6e3ddd 100644 --- a/search/files_2.js +++ b/search/files_2.js @@ -3,5 +3,6 @@ var searchData= ['camera_2ecpp',['camera.cpp',['../camera_8cpp.html',1,'']]], ['camera_2eh',['camera.h',['../camera_8h.html',1,'']]], ['collider_2eh',['collider.h',['../collider_8h.html',1,'']]], - ['collisionbody_2eh',['collisionbody.h',['../collisionbody_8h.html',1,'']]] + ['collisionbody_2eh',['collisionbody.h',['../collisionbody_8h.html',1,'']]], + ['component_2eh',['component.h',['../component_8h.html',1,'']]] ]; diff --git a/search/files_4.js b/search/files_4.js index f4e207d8..e14d9c37 100644 --- a/search/files_4.js +++ b/search/files_4.js @@ -1,4 +1,10 @@ var searchData= [ - ['ellipse_2eh',['ellipse.h',['../ellipse_8h.html',1,'']]] + ['ellipse_2eh',['ellipse.h',['../ellipse_8h.html',1,'']]], + ['engine_2ecpp',['engine.cpp',['../engine_8cpp.html',1,'']]], + ['engine_2eh',['engine.h',['../engine_8h.html',1,'']]], + ['entity_2ecpp',['entity.cpp',['../entity_8cpp.html',1,'']]], + ['entity_2eh',['entity.h',['../entity_8h.html',1,'']]], + ['entitymanager_2ecpp',['entitymanager.cpp',['../entitymanager_8cpp.html',1,'']]], + ['entitymanager_2eh',['entitymanager.h',['../entitymanager_8h.html',1,'']]] ]; diff --git a/search/files_6.js b/search/files_6.js index 8c02e7f3..096f856d 100644 --- a/search/files_6.js +++ b/search/files_6.js @@ -1,8 +1,8 @@ var searchData= [ ['logger_2ecpp',['logger.cpp',['../logger_8cpp.html',1,'']]], - ['logger_2edox',['logger.dox',['../logger_8dox.html',1,'']]], ['logger_2eh',['logger.h',['../logger_8h.html',1,'']]], + ['logger_2emd',['logger.md',['../logger_8md.html',1,'']]], ['loglevel_2eh',['loglevel.h',['../loglevel_8h.html',1,'']]], ['logmessage_2ecpp',['logmessage.cpp',['../logmessage_8cpp.html',1,'']]], ['logmessage_2eh',['logmessage.h',['../logmessage_8h.html',1,'']]], diff --git a/search/files_7.js b/search/files_7.js index 42177e69..8e37376a 100644 --- a/search/files_7.js +++ b/search/files_7.js @@ -1,5 +1,6 @@ var searchData= [ - ['matrix_2edox',['matrix.dox',['../matrix_8dox.html',1,'']]], - ['matrix_2eh',['matrix.h',['../matrix_8h.html',1,'']]] + ['main_2emd',['main.md',['../main_8md.html',1,'']]], + ['matrix_2eh',['matrix.h',['../matrix_8h.html',1,'']]], + ['matrix_2emd',['matrix.md',['../matrix_8md.html',1,'']]] ]; diff --git a/search/files_a.js b/search/files_a.js index e6d66a8b..8b2e785e 100644 --- a/search/files_a.js +++ b/search/files_a.js @@ -3,13 +3,17 @@ var searchData= ['shader_2ecpp',['shader.cpp',['../shader_8cpp.html',1,'']]], ['shader_2eh',['shader.h',['../shader_8h.html',1,'']]], ['shape_2eh',['shape.h',['../shape_8h.html',1,'']]], + ['space_2ecpp',['space.cpp',['../space_8cpp.html',1,'']]], + ['space_2eh',['space.h',['../space_8h.html',1,'']]], ['sprite_2ecpp',['sprite.cpp',['../sprite_8cpp.html',1,'']]], ['sprite_2eh',['sprite.h',['../sprite_8h.html',1,'']]], ['spritebatch_2ecpp',['spritebatch.cpp',['../spritebatch_8cpp.html',1,'']]], ['spritebatch_2eh',['spritebatch.h',['../spritebatch_8h.html',1,'']]], + ['spritebatch_2emd',['spritebatch.md',['../spritebatch_8md.html',1,'']]], ['spritesheet_2ecpp',['spritesheet.cpp',['../spritesheet_8cpp.html',1,'']]], ['spritesheet_2eh',['spritesheet.h',['../spritesheet_8h.html',1,'']]], ['stb_5fimage_2ecpp',['stb_image.cpp',['../stb__image_8cpp.html',1,'']]], ['stb_5fimage_2eh',['stb_image.h',['../stb__image_8h.html',1,'']]], - ['syncqueue_2eh',['syncqueue.h',['../syncqueue_8h.html',1,'']]] + ['syncqueue_2eh',['syncqueue.h',['../syncqueue_8h.html',1,'']]], + ['system_2eh',['system.h',['../system_8h.html',1,'']]] ]; diff --git a/search/files_b.js b/search/files_b.js index b27f863e..19908353 100644 --- a/search/files_b.js +++ b/search/files_b.js @@ -3,5 +3,5 @@ var searchData= ['texture_2eh',['texture.h',['../texture_8h.html',1,'']]], ['texturecache_2ecpp',['texturecache.cpp',['../texturecache_8cpp.html',1,'']]], ['texturecache_2eh',['texturecache.h',['../texturecache_8h.html',1,'']]], - ['todolist_2edox',['todolist.dox',['../todolist_8dox.html',1,'']]] + ['todolist_2emd',['todolist.md',['../todolist_8md.html',1,'']]] ]; diff --git a/search/functions_0.js b/search/functions_0.js index a92378b9..d2494ce5 100644 --- a/search/functions_0.js +++ b/search/functions_0.js @@ -2,5 +2,6 @@ var searchData= [ ['active',['Active',['../classyage_1_1Active.html#a7cd7344f0b8b7aa93ac0449e2fbbf7bd',1,'yage::Active']]], ['add',['add',['../classyage_1_1Logger.html#a5ec9a752e8cbb278342fdb49520fbcdd',1,'yage::Logger']]], + ['addsystem',['addSystem',['../classyage_1_1Engine.html#ab605c8ab3209e6cb1a8b0d45eb6180b6',1,'yage::Engine']]], ['applyforce',['applyForce',['../classyage_1_1Body.html#a56310be4f9d7d2d4e7f954af0e0a5878',1,'yage::Body::applyForce()'],['../classyage_1_1ParticleBody.html#a4d6c52fc2106ebd3f131d2be1fa3f11b',1,'yage::ParticleBody::applyForce()']]] ]; diff --git a/search/functions_10.js b/search/functions_10.js index ec3fcb05..06e3b7e9 100644 --- a/search/functions_10.js +++ b/search/functions_10.js @@ -9,6 +9,7 @@ var searchData= ['shader',['Shader',['../classyage_1_1Shader.html#a34fe30eb6e6d595c1996e8ea6fb3961a',1,'yage::Shader::Shader(const std::string &vertex_path, const std::string &fragment_path)'],['../classyage_1_1Shader.html#a1a006dcb52a4fb9f1dc61df68d3676f5',1,'yage::Shader::Shader(const Shader &)=delete'],['../classyage_1_1Shader.html#adf6dc3a526921d62b55a552f38958dd2',1,'yage::Shader::Shader(Shader &&)=delete']]], ['shouldclose',['shouldClose',['../classyage_1_1Window.html#a5e3b209289bc343609d809d5b7f23cc8',1,'yage::Window']]], ['show',['show',['../classyage_1_1Window.html#a0847f40df2aafd7da1c315fa84871f34',1,'yage::Window']]], + ['space',['Space',['../classyage_1_1Space.html#a40c248478ae521bb4e0d5119002cf8e9',1,'yage::Space']]], ['sprite',['Sprite',['../classyage_1_1Sprite.html#a113bfddfa62846a1d8391d1b86de7987',1,'yage::Sprite::Sprite()=default'],['../classyage_1_1Sprite.html#aa5a7958e17f1d042226b91fb1829642e',1,'yage::Sprite::Sprite(const Sprite &)=delete'],['../classyage_1_1Sprite.html#a33789b3e37bfcb84ed89ec69f47817a1',1,'yage::Sprite::Sprite(Sprite &&)=delete'],['../classyage_1_1SpriteSheet.html#a2734c2e7b8bdfc9090d240c070ee55c0',1,'yage::SpriteSheet::sprite()']]], ['spritebatch',['SpriteBatch',['../classyage_1_1SpriteBatch.html#afda50a8a2a6c9ffd1b9d962fae223f8a',1,'yage::SpriteBatch::SpriteBatch()'],['../classyage_1_1SpriteBatch.html#a30a46a7182235a739916d540781af652',1,'yage::SpriteBatch::SpriteBatch(const SpriteBatch &)=delete'],['../classyage_1_1SpriteBatch.html#a7f18a506f4188acd2219da8147dc0e1e',1,'yage::SpriteBatch::SpriteBatch(SpriteBatch &&)=delete']]], ['spritesheet',['SpriteSheet',['../classyage_1_1SpriteSheet.html#a73db999ab17c4846f036eb47470176f6',1,'yage::SpriteSheet']]], diff --git a/search/functions_12.js b/search/functions_12.js index dc91ba1d..a5fd3220 100644 --- a/search/functions_12.js +++ b/search/functions_12.js @@ -1,6 +1,6 @@ var searchData= [ - ['update',['update',['../classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c',1,'yage::Camera::update()'],['../classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36',1,'yage::Body::update()'],['../classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c',1,'yage::ParticleBody::update()']]], + ['update',['update',['../classyage_1_1Camera.html#a99f0af50db990c5558fd0b7b82f3978c',1,'yage::Camera::update()'],['../classyage_1_1Engine.html#a8d888a2871d93f40b98ecf3548dd8d67',1,'yage::Engine::update()'],['../classyage_1_1System.html#a882cfa13fc76d106c9d0ca68b17ff1ff',1,'yage::System::update()'],['../classyage_1_1Body.html#a17017d183f3f9ecdff779fd6f82c5d36',1,'yage::Body::update()'],['../classyage_1_1ParticleBody.html#a1f24ef00fd59254397d677d90936ec4c',1,'yage::ParticleBody::update()']]], ['use',['use',['../classyage_1_1Shader.html#a8cd66c177f148ac0b619766188696e6c',1,'yage::Shader']]], ['uv',['UV',['../structyage_1_1UV.html#ae236139f3a5f6024aac1e21bd93b7bde',1,'yage::UV::UV()=default'],['../structyage_1_1UV.html#ac918524789292937aae5803df3c2673f',1,'yage::UV::UV(float u_, float v_)']]] ]; diff --git a/search/functions_18.js b/search/functions_18.js index 4a39058c..650b6532 100644 --- a/search/functions_18.js +++ b/search/functions_18.js @@ -6,5 +6,6 @@ var searchData= ['_7eshader',['~Shader',['../classyage_1_1Shader.html#a9307c4f3cfaf5e584b70601294e09bdd',1,'yage::Shader']]], ['_7esprite',['~Sprite',['../classyage_1_1Sprite.html#aa2f833e040940616fa17ee8f02f8cab2',1,'yage::Sprite']]], ['_7espritebatch',['~SpriteBatch',['../classyage_1_1SpriteBatch.html#afa26d86730be23aa5e0c8c4a9d67001a',1,'yage::SpriteBatch']]], + ['_7esystem',['~System',['../classyage_1_1System.html#a32e00cf7f9b517a43e7db16d2aaa9b57',1,'yage::System']]], ['_7ewindow',['~Window',['../classyage_1_1Window.html#a9a8dd109e145c459e52abb3a8861e3a0',1,'yage::Window']]] ]; diff --git a/search/functions_2.js b/search/functions_2.js index e1f09b78..9509e429 100644 --- a/search/functions_2.js +++ b/search/functions_2.js @@ -9,5 +9,7 @@ var searchData= ['colour',['Colour',['../structyage_1_1Colour.html#a585165d5109c81b6b2de6f1116406abd',1,'yage::Colour::Colour()'],['../structyage_1_1Colour.html#a8118ad802db7e61df770f7d3b5b88aaa',1,'yage::Colour::Colour(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)']]], ['colsize',['colSize',['../classyage_1_1Matrix.html#a2148cd52008892765ad90250c68afba1',1,'yage::Matrix']]], ['coordinate',['Coordinate',['../structyage_1_1details_1_1Coordinate.html#a0b3a6d9aa1d5b846ad7ebc11bc77c629',1,'yage::details::Coordinate::Coordinate()=default'],['../structyage_1_1details_1_1Coordinate.html#a43fb6bd3e325d5cd7ec436778605db2a',1,'yage::details::Coordinate::Coordinate(int x_i, int y_i, int width_i, int height_i)']]], - ['create',['create',['../classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745',1,'yage::Window::create()'],['../classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064',1,'yage::Active::create()']]] + ['create',['create',['../classyage_1_1Window.html#afdf3e2826526abc23a4e206c9a8a8745',1,'yage::Window::create()'],['../classyage_1_1Active.html#aa2ed414bbe94fdd51c8aeb7ada73a064',1,'yage::Active::create()']]], + ['createentity',['createEntity',['../classyage_1_1EntityManager.html#acdd054a1235fb03452089d9f419a7e2b',1,'yage::EntityManager::createEntity()'],['../classyage_1_1Space.html#a41bc332ffb3042c0872ede8c53ff1fa4',1,'yage::Space::createEntity()']]], + ['createentityinstance',['createEntityInstance',['../classyage_1_1EntityManager.html#a188f3bc252781f9f3a7b4da417f0d7de',1,'yage::EntityManager']]] ]; diff --git a/search/functions_4.js b/search/functions_4.js index 10b10be0..1cc6491c 100644 --- a/search/functions_4.js +++ b/search/functions_4.js @@ -1,4 +1,6 @@ var searchData= [ - ['end',['end',['../classyage_1_1Matrix.html#a20ea5fe16d27ef15f775b5497cadc851',1,'yage::Matrix::end()'],['../classyage_1_1Batch.html#a322b0fe531c9cfa506d6d2dd786a236e',1,'yage::Batch::end()'],['../classyage_1_1SpriteBatch.html#af8b705cdad7ceefa902f3be620ac8632',1,'yage::SpriteBatch::end()']]] + ['end',['end',['../classyage_1_1Matrix.html#a20ea5fe16d27ef15f775b5497cadc851',1,'yage::Matrix::end()'],['../classyage_1_1Batch.html#a322b0fe531c9cfa506d6d2dd786a236e',1,'yage::Batch::end()'],['../classyage_1_1SpriteBatch.html#af8b705cdad7ceefa902f3be620ac8632',1,'yage::SpriteBatch::end()']]], + ['entity',['Entity',['../classyage_1_1Entity.html#a046099f19b3483140505938769276d8a',1,'yage::Entity']]], + ['entitymanager',['EntityManager',['../classyage_1_1EntityManager.html#a255fa9aff3e6b208eea0c38d8caf08f8',1,'yage::EntityManager::EntityManager()=default'],['../classyage_1_1EntityManager.html#a0099fe0038967007891d2b7575090915',1,'yage::EntityManager::EntityManager(Space *space)'],['../classyage_1_1EntityManager.html#af1644095d96e43ac000375ba7f7ee021',1,'yage::EntityManager::EntityManager(Space *space, std::size_t n)']]] ]; diff --git a/search/functions_6.js b/search/functions_6.js index 3fea5334..49d6797a 100644 --- a/search/functions_6.js +++ b/search/functions_6.js @@ -1,9 +1,10 @@ var searchData= [ ['getcol',['getCol',['../classyage_1_1Matrix.html#a74475218328d6ef69701a6e261df925b',1,'yage::Matrix']]], + ['gethandle',['getHandle',['../classyage_1_1Entity.html#adb9e45f096a38c1057bba28acf7dde71',1,'yage::Entity']]], ['getrow',['getRow',['../classyage_1_1Matrix.html#a960273d1ac46a8edb71ceee08ee639b8',1,'yage::Matrix']]], ['gettexture',['getTexture',['../classyage_1_1ResourceManager.html#aec533f266d9b432050faed301f4191dc',1,'yage::ResourceManager::getTexture()'],['../classyage_1_1TextureCache.html#ad4929640230f9a74fcd634416fe0974f',1,'yage::TextureCache::getTexture()']]], ['gettexturefromspritesheet',['getTextureFromSpriteSheet',['../classyage_1_1TextureCache.html#abb785ce35eb847c02de67dc9e6e06bcd',1,'yage::TextureCache']]], - ['glfwerrorcallback',['glfwErrorCallback',['../namespaceyage.html#a0bd2fedcbe862fdea1ea54b6b7d49bec',1,'yage']]], + ['glfwerrorcallback',['glfwErrorCallback',['../namespaceyage.html#ae53246342d5b0371f300336cbc6595a3',1,'yage']]], ['glyph',['Glyph',['../structyage_1_1details_1_1Glyph.html#a91752b58fc10fb037658f27c9338627c',1,'yage::details::Glyph']]] ]; diff --git a/search/functions_8.js b/search/functions_8.js index 507861e5..2d268bc1 100644 --- a/search/functions_8.js +++ b/search/functions_8.js @@ -1,6 +1,6 @@ var searchData= [ - ['init',['init',['../classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477',1,'yage::Batch::init()'],['../classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1',1,'yage::Sprite::init()'],['../namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce',1,'yage::init()']]], + ['init',['init',['../classyage_1_1Engine.html#a41073d8b8117e567357fe46fed01bbe4',1,'yage::Engine::init()'],['../classyage_1_1System.html#ad697e043fcf7dbcf77821f49073f5af9',1,'yage::System::init()'],['../classyage_1_1Batch.html#a0040228902f0a4cca90da23f36a7c477',1,'yage::Batch::init()'],['../classyage_1_1Sprite.html#a2f6294be8b2551077cf475892bcddcc1',1,'yage::Sprite::init()'],['../namespaceyage.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce',1,'yage::init()']]], ['inside',['inside',['../classyage_1_1Collider.html#a4a8ad9e664a0015e023a70d196302fe9',1,'yage::Collider::inside()'],['../classyage_1_1RectangleCollider.html#ac8d8e6bdb12c21be12f7d398242147c4',1,'yage::RectangleCollider::inside()']]], - ['instance',['instance',['../classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e',1,'yage::Logger']]] + ['instance',['instance',['../classyage_1_1Logger.html#ad165738c5b738d80a14b0ee1319cae2e',1,'yage::Logger::instance()'],['../classyage_1_1Engine.html#a7e4303fa3bd951ee64e166d6e0fb7b33',1,'yage::Engine::instance()']]] ]; diff --git a/search/functions_b.js b/search/functions_b.js index 43be41e3..e3e2fe35 100644 --- a/search/functions_b.js +++ b/search/functions_b.js @@ -1,5 +1,6 @@ var searchData= [ + ['mainloop',['mainLoop',['../classyage_1_1Engine.html#a245478397be4ca0d9ac6af84c1753e42',1,'yage::Engine']]], ['makeconsolesink',['makeConsoleSink',['../namespaceyage.html#ab54350a8dbf59338c99ab4f43cfa2858',1,'yage']]], ['makefilesink',['makeFileSink',['../namespaceyage.html#ad537beeea51c8314e407fadd24affc34',1,'yage::makeFileSink(const std::string &filename)'],['../namespaceyage.html#a6b288197f6a97f197dda60e5b54f1841',1,'yage::makeFileSink(std::string &&filename)']]], ['matrix',['Matrix',['../classyage_1_1Matrix.html#a73b7d1f94f4f72a2294b71b3a35794ad',1,'yage::Matrix::Matrix()'],['../classyage_1_1Matrix.html#a191b02ff353d04f18779d4c84e20927b',1,'yage::Matrix::Matrix(const std::vector< Type > &data)']]], diff --git a/search/pages_0.js b/search/pages_0.js index 8d42650d..978e53b3 100644 --- a/search/pages_0.js +++ b/search/pages_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['bug_20list',['Bug List',['../bug.html',1,'']]] + ['add_20comments',['Add Comments',['../md_docs_todolist.html',1,'']]] ]; diff --git a/search/pages_1.js b/search/pages_1.js index 038da541..8d42650d 100644 --- a/search/pages_1.js +++ b/search/pages_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['deprecated_20list',['Deprecated List',['../deprecated.html',1,'']]] + ['bug_20list',['Bug List',['../bug.html',1,'']]] ]; diff --git a/search/pages_2.js b/search/pages_2.js index 4c4cca2b..038da541 100644 --- a/search/pages_2.js +++ b/search/pages_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['physics_20engine',['Physics Engine',['../md_yage_physics_README.html',1,'']]] + ['deprecated_20list',['Deprecated List',['../deprecated.html',1,'']]] ]; diff --git a/search/pages_3.js b/search/pages_3.js index 441b2dec..58ac2e4b 100644 --- a/search/pages_3.js +++ b/search/pages_3.js @@ -1,4 +1,4 @@ var searchData= [ - ['todo_20list',['Todo List',['../todo.html',1,'']]] + ['logger',['Logger',['../logger_guide.html',1,'']]] ]; diff --git a/search/pages_4.js b/search/pages_4.js index 62ccbfb4..50b3a64a 100644 --- a/search/pages_4.js +++ b/search/pages_4.js @@ -1,4 +1,4 @@ var searchData= [ - ['yage',['YAGE',['../index.html',1,'']]] + ['matrix_20guide',['Matrix Guide',['../matrix_guide.html',1,'']]] ]; diff --git a/search/pages_5.html b/search/pages_5.html new file mode 100644 index 00000000..02c11148 --- /dev/null +++ b/search/pages_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_5.js b/search/pages_5.js new file mode 100644 index 00000000..4c4cca2b --- /dev/null +++ b/search/pages_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['physics_20engine',['Physics Engine',['../md_yage_physics_README.html',1,'']]] +]; diff --git a/search/pages_6.html b/search/pages_6.html new file mode 100644 index 00000000..afb70afd --- /dev/null +++ b/search/pages_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_6.js b/search/pages_6.js new file mode 100644 index 00000000..39e0d94c --- /dev/null +++ b/search/pages_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['sprite_20batching',['Sprite Batching',['../spritebatch_guide.html',1,'']]] +]; diff --git a/search/pages_7.html b/search/pages_7.html new file mode 100644 index 00000000..9d7ba25f --- /dev/null +++ b/search/pages_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_7.js b/search/pages_7.js new file mode 100644 index 00000000..441b2dec --- /dev/null +++ b/search/pages_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['todo_20list',['Todo List',['../todo.html',1,'']]] +]; diff --git a/search/pages_8.html b/search/pages_8.html new file mode 100644 index 00000000..33778878 --- /dev/null +++ b/search/pages_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_8.js b/search/pages_8.js new file mode 100644 index 00000000..83bdc55e --- /dev/null +++ b/search/pages_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['yage',['YAGE',['../index.html',1,'']]], + ['yage',['YAGE',['../md_README.html',1,'']]] +]; diff --git a/search/search.css b/search/search.css index 4d7612ff..e8187b17 100644 --- a/search/search.css +++ b/search/search.css @@ -100,8 +100,8 @@ display: none; position: absolute; left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; + border: 1px solid #ED9071; + background-color: #FEF9F7; z-index: 1; padding-top: 4px; padding-bottom: 4px; @@ -145,7 +145,7 @@ a.SelectItem:active { a.SelectItem:hover { color: #FFFFFF; - background-color: #3D578C; + background-color: #B33D15; outline-style: none; text-decoration: none; cursor: pointer; @@ -164,7 +164,7 @@ iframe#MSearchResults { position: absolute; left: 0; top: 0; border: 1px solid #000; - background-color: #EEF1F7; + background-color: #FCEEE9; } /* ----------------------------------- */ @@ -199,7 +199,7 @@ body.SRPage { .SRSymbol { font-weight: bold; - color: #425E97; + color: #C24217; font-family: Arial, Verdana, sans-serif; text-decoration: none; outline: none; @@ -207,7 +207,7 @@ body.SRPage { a.SRScope { display: block; - color: #425E97; + color: #C24217; font-family: Arial, Verdana, sans-serif; text-decoration: none; outline: none; @@ -240,7 +240,7 @@ DIV.searchresults { /*---------------- External search page results */ .searchresult { - background-color: #F0F3F8; + background-color: #FCF0EC; } .pages b { diff --git a/search/search.js b/search/search.js index 5fff46bf..812eba6b 100644 --- a/search/search.js +++ b/search/search.js @@ -8,17 +8,17 @@ var indexSectionsWithContent = { 0: "abcdefghijklmnopqrstuvwxyz~", - 1: "abcdgilmprstuvw", + 1: "abcdegilmprstuvw", 2: "y", 3: "abcdeilmprstvwy", 4: "abcdefghiklmopqrstuvwxyz~", 5: "abcdefghilmnoprstuvwxyz", 6: "csv", - 7: "klw", + 7: "cklw", 8: "abcdefghijklmnopqrstuvwxyz", 9: "dl", 10: "gsy", - 11: "bdpty" + 11: "abdlmpsty" }; var indexSectionNames = diff --git a/shader_8cpp.html b/shader_8cpp.html index 7483407f..392a864d 100644 --- a/shader_8cpp.html +++ b/shader_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -124,7 +108,7 @@ $(document).ready(function(){initNavTree('shader_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -132,15 +116,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/shader_8h.html b/shader_8h.html index ebff8cea..4ce95bd6 100644 --- a/shader_8h.html +++ b/shader_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -115,8 +99,8 @@ $(document).ready(function(){initNavTree('shader_8h.html','');});


    More...

    -
    #include <glm/glm.hpp>
    -#include <glad/glad.h>
    +
    #include <glad/glad.h>
    +#include <glm/glm.hpp>
    #include <string>

    Go to the source code of this file.

    @@ -129,7 +113,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -137,15 +121,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    -
    - + diff --git a/shader_8h_source.html b/shader_8h_source.html index 758d1811..235860bc 100644 --- a/shader_8h_source.html +++ b/shader_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    shader.h
    @@ -112,8 +96,8 @@ $(document).ready(function(){initNavTree('shader_8h_source.html','');});
    9 #ifndef YAGE_RENDER_SHADER_H
    10 #define YAGE_RENDER_SHADER_H
    11 
    -
    12 #include <glm/glm.hpp>
    -
    13 #include <glad/glad.h>
    +
    12 #include <glad/glad.h>
    +
    13 #include <glm/glm.hpp>
    14 
    15 #include <string>
    16 
    @@ -154,15 +138,11 @@ $(document).ready(function(){initNavTree('shader_8h_source.html','');});
    ~Shader()
    Definition: shader.cpp:74
    void use() const
    compiles vertex and fragment shader
    Definition: shader.cpp:82
    - - + diff --git a/shape_8h.html b/shape_8h.html index e5f29f8b..4cff86a6 100644 --- a/shape_8h.html +++ b/shape_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -111,6 +95,10 @@ $(document).ready(function(){initNavTree('shape_8h.html','');});
    shape.h File Reference
    + +


    + +More...

    #include "drawable.h"

    Go to the source code of this file.

    @@ -123,19 +111,19 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
      -
    - +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    - + diff --git a/shape_8h_source.html b/shape_8h_source.html index 72193c3b..b15ecfb4 100644 --- a/shape_8h_source.html +++ b/shape_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    shape.h
    -Go to the documentation of this file.
    1 #ifndef YAGE_RENDER_SHAPE_H
    -
    2 #define YAGE_RENDER_SHAPE_H
    -
    3 
    -
    4 #include "drawable.h"
    -
    5 
    -
    6 namespace yage
    -
    7 {
    -
    8 
    -
    9 class Shape : public Drawable
    -
    10 {
    -
    11 public:
    -
    12  virtual void render() const;
    -
    13 };
    -
    14 
    -
    15 } // namespace yage
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_RENDER_SHAPE_H
    +
    10 #define YAGE_RENDER_SHAPE_H
    +
    11 
    +
    12 #include "drawable.h"
    +
    13 
    +
    14 namespace yage
    +
    15 {
    16 
    -
    17 #endif
    -
    Definition: shape.h:9
    - +
    17 class Shape : public Drawable
    +
    18 {
    +
    19 public:
    +
    20  virtual void render() const;
    +
    21 };
    +
    22 
    +
    23 } // namespace yage
    +
    24 
    +
    25 #endif
    +
    Definition: shape.h:17
    +
    virtual void render() const
    -
    Definition: drawable.h:9
    +
    Definition: drawable.h:17
    -
    - + diff --git a/space_8cpp.html b/space_8cpp.html new file mode 100644 index 00000000..f0735f34 --- /dev/null +++ b/space_8cpp.html @@ -0,0 +1,121 @@ + + + + + + +YAGE: yage/engine/space.cpp File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + + +
    +
    + +
    +
    space.cpp File Reference
    +
    +
    + +


    + +More...

    +
    #include "space.h"
    +
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/space_8h.html b/space_8h.html new file mode 100644 index 00000000..4a479855 --- /dev/null +++ b/space_8h.html @@ -0,0 +1,131 @@ + + + + + + +YAGE: yage/engine/space.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + + +
    +
    + +
    +
    space.h File Reference
    +
    +
    + +


    + +More...

    +
    #include <vector>
    +#include "entitymanager.h"
    +
    +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  yage::Space
     Space that keeps track of all the entities, componenets and runs the systems on the data to update them. More...
     
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/space_8h_source.html b/space_8h_source.html new file mode 100644 index 00000000..503ba584 --- /dev/null +++ b/space_8h_source.html @@ -0,0 +1,137 @@ + + + + + + +YAGE: yage/engine/space.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + + +
    +
    +
    +
    space.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_ENGINE_SPACE_H
    +
    10 #define YAGE_ENGINE_SPACE_H
    +
    11 
    +
    12 #include <vector>
    +
    13 
    +
    14 #include "entitymanager.h"
    +
    15 
    +
    16 namespace yage
    +
    17 {
    +
    18 
    +
    19 class System;
    +
    20 
    +
    28 class Space
    +
    29 {
    +
    30 public:
    +
    34  Space();
    +
    35 
    +
    42  unsigned createEntity();
    +
    43 
    +
    44 private:
    +
    50  std::vector<System *> systems_;
    +
    51 
    +
    56  EntityManager em_;
    +
    57 };
    +
    58 
    +
    59 } // namespace yage
    +
    60 
    +
    61 #endif
    +
    Manages entities in a space.
    Definition: entitymanager.h:24
    +
    Space()
    Default instance for a space.
    Definition: space.cpp:14
    + +
    unsigned createEntity()
    Create an entity that will belong to this space, and return the handle to the user.
    Definition: space.cpp:16
    +
    Space that keeps track of all the entities, componenets and runs the systems on the data to update th...
    Definition: space.h:28
    +
    + + + + diff --git a/sprite_8cpp.html b/sprite_8cpp.html index 48dad913..92255307 100644 --- a/sprite_8cpp.html +++ b/sprite_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -122,7 +106,7 @@ $(document).ready(function(){initNavTree('sprite_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -130,15 +114,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/sprite_8h.html b/sprite_8h.html index b0ef3eb7..42dee1ee 100644 --- a/sprite_8h.html +++ b/sprite_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -129,7 +113,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -137,15 +121,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/sprite_8h_source.html b/sprite_8h_source.html index 6ac2e051..55b8ab09 100644 --- a/sprite_8h_source.html +++ b/sprite_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    sprite.h
    @@ -156,15 +140,11 @@ $(document).ready(function(){initNavTree('sprite_8h_source.html','');});
    Sprite & operator=(const Sprite &)=delete
    Definition: sprite.h:23
    - - + diff --git a/spritebatch_8cpp.html b/spritebatch_8cpp.html index 6b647e16..b8b27dcf 100644 --- a/spritebatch_8cpp.html +++ b/spritebatch_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -124,7 +108,7 @@ $(document).ready(function(){initNavTree('spritebatch_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -132,15 +116,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/spritebatch_8h.html b/spritebatch_8h.html index 00db7b90..8c15a76d 100644 --- a/spritebatch_8h.html +++ b/spritebatch_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -136,7 +120,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
       yage::details   @@ -146,15 +130,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/spritebatch_8h_source.html b/spritebatch_8h_source.html index b0f83986..6d09183d 100644 --- a/spritebatch_8h_source.html +++ b/spritebatch_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    spritebatch.h
    @@ -217,20 +201,16 @@ $(document).ready(function(){initNavTree('spritebatch_8h_source.html','');});
    float depth
    Definition: spritebatch.h:41
    Definition: vertex.h:26
    Vertex top_right
    Definition: spritebatch.h:43
    - +
    Glyph with information of the texture.
    Definition: spritebatch.h:39
    GLsizei num_vertices
    Definition: spritebatch.h:28
    ~SpriteBatch()
    Definition: spritebatch.cpp:55
    - - + diff --git a/spritebatch_8md.html b/spritebatch_8md.html new file mode 100644 index 00000000..de6853f1 --- /dev/null +++ b/spritebatch_8md.html @@ -0,0 +1,99 @@ + + + + + + +YAGE: docs/spritebatch.md File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + +
    +
    +
    +
    docs/spritebatch.md File Reference
    +
    +
    +
    + + + + diff --git a/spritebatch_guide.html b/spritebatch_guide.html new file mode 100644 index 00000000..adde1239 --- /dev/null +++ b/spritebatch_guide.html @@ -0,0 +1,93 @@ + + + + + + +YAGE: Sprite Batching + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    +
    Sprite Batching
    +
    +
    +
    + + + + diff --git a/spritesheet_8cpp.html b/spritesheet_8cpp.html index f0cebe6e..22e252d3 100644 --- a/spritesheet_8cpp.html +++ b/spritesheet_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -125,7 +109,7 @@ $(document).ready(function(){initNavTree('spritesheet_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -133,15 +117,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/spritesheet_8h.html b/spritesheet_8h.html index b4f3415c..87c0994d 100644 --- a/spritesheet_8h.html +++ b/spritesheet_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -133,7 +117,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
       yage::details   @@ -149,15 +133,11 @@ details::Coordinate > Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/spritesheet_8h.js b/spritesheet_8h.js deleted file mode 100644 index e8d8b247..00000000 --- a/spritesheet_8h.js +++ /dev/null @@ -1,6 +0,0 @@ -var spritesheet_8h = -[ - [ "Coordinate", "structyage_1_1details_1_1Coordinate.html", "structyage_1_1details_1_1Coordinate" ], - [ "SpriteSheet", "classyage_1_1SpriteSheet.html", "classyage_1_1SpriteSheet" ], - [ "SpriteMap", "spritesheet_8h.html#a035f63ad1a3114ada8157ed4182521c9", null ] -]; \ No newline at end of file diff --git a/spritesheet_8h_source.html b/spritesheet_8h_source.html index 6bef07cf..b4f2f701 100644 --- a/spritesheet_8h_source.html +++ b/spritesheet_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    spritesheet.h
    @@ -177,15 +161,11 @@ $(document).ready(function(){initNavTree('spritesheet_8h_source.html','');});
    int y
    Definition: spritesheet.h:33
    std::string fileContent(std::string jsonFileName) const
    Definition: spritesheet.cpp:41
    - - + diff --git a/stb__image_8cpp.html b/stb__image_8cpp.html index 861b3aae..ee353951 100644 --- a/stb__image_8cpp.html +++ b/stb__image_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -131,15 +115,11 @@ Macros
    - - + diff --git a/stb__image_8cpp.js b/stb__image_8cpp.js deleted file mode 100644 index 97bc2d98..00000000 --- a/stb__image_8cpp.js +++ /dev/null @@ -1,4 +0,0 @@ -var stb__image_8cpp = -[ - [ "STB_IMAGE_IMPLEMENTATION", "stb__image_8cpp.html#a18372412ad2fc3ce1e3240b3cf0efe78", null ] -]; \ No newline at end of file diff --git a/stb__image_8h.html b/stb__image_8h.html index 4cc16f21..b8765f96 100644 --- a/stb__image_8h.html +++ b/stb__image_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -1478,15 +1462,11 @@ Functions
    - - + diff --git a/stb__image_8h.js b/stb__image_8h.js deleted file mode 100644 index 73799cb9..00000000 --- a/stb__image_8h.js +++ /dev/null @@ -1,48 +0,0 @@ -var stb__image_8h = -[ - [ "stbi_io_callbacks", "structstbi__io__callbacks.html", "structstbi__io__callbacks" ], - [ "STBI_VERSION", "stb__image_8h.html#aed6cd14a3bf678808c4c179e808866aa", null ], - [ "STBIDEF", "stb__image_8h.html#a2d9ec9850cd12aefe7641b456266a4c2", null ], - [ "stbi_uc", "stb__image_8h.html#a28eb51a1512ce382ee50f20e1d04d50d", null ], - [ "stbi_us", "stb__image_8h.html#a648037d4c55689328ba08c8f5d293df2", null ], - [ "STBI_default", "stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba0177ac2c5002f4f251bb766d41752029", null ], - [ "STBI_grey", "stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55bad1eb95ca1fa7706bf732bf35a0ed40aa", null ], - [ "STBI_grey_alpha", "stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baf5829d16d4cca6077465c5abd346e2f8", null ], - [ "STBI_rgb", "stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baa59123e5d0af25f9b1539f5cf1facddf", null ], - [ "STBI_rgb_alpha", "stb__image_8h.html#a06fc87d81c62e9abb8790b6e5713c55baa7b1af0c9f0310c3ada2aa29a32de293", null ], - [ "stbi_convert_iphone_png_to_rgb", "stb__image_8h.html#a23525ef2b882f3de426b47ecf8d9151b", null ], - [ "stbi_failure_reason", "stb__image_8h.html#aa874b3ba909f3281d499894909678336", null ], - [ "stbi_hdr_to_ldr_gamma", "stb__image_8h.html#ab18889e43518d6b4421b705782bb1b5e", null ], - [ "stbi_hdr_to_ldr_scale", "stb__image_8h.html#ae21cc1184eeb5cc814699f1ed62c5258", null ], - [ "stbi_image_free", "stb__image_8h.html#ad3e11bb44412a7ba348acfbad09caacb", null ], - [ "stbi_info", "stb__image_8h.html#aede708cca1304520b2afcf4d5eb61d70", null ], - [ "stbi_info_from_callbacks", "stb__image_8h.html#a86291c64cb663f41a34647d5e1abf363", null ], - [ "stbi_info_from_file", "stb__image_8h.html#a28abedef4a0a93909332080df6be0021", null ], - [ "stbi_info_from_memory", "stb__image_8h.html#acfef077febce3bc3f1f339de478f3315", null ], - [ "stbi_is_hdr", "stb__image_8h.html#ae70f9a302f7e87fd971075e7f758d55c", null ], - [ "stbi_is_hdr_from_callbacks", "stb__image_8h.html#af0e94f316fe1848f632517ca3c11d077", null ], - [ "stbi_is_hdr_from_file", "stb__image_8h.html#aaf10d41631e1e9214fde1688bdbd8524", null ], - [ "stbi_is_hdr_from_memory", "stb__image_8h.html#a5cbc6f5cbb3b2d0d87ee959fcee9d23e", null ], - [ "stbi_ldr_to_hdr_gamma", "stb__image_8h.html#a1feccdcf726dcc6b5502e3efa85b7dbb", null ], - [ "stbi_ldr_to_hdr_scale", "stb__image_8h.html#af946583656a362a316b40c0421c20561", null ], - [ "stbi_load", "stb__image_8h.html#aefdc7387857a14894bbf321e9ea4f048", null ], - [ "stbi_load_16", "stb__image_8h.html#a8a58b6bcd805afa1bdb14f988dd37fee", null ], - [ "stbi_load_16_from_callbacks", "stb__image_8h.html#a82bcc0957b6a4ebfdfa3d7f04fbaed18", null ], - [ "stbi_load_16_from_memory", "stb__image_8h.html#ad30fd870ed2138ce8f38c9dd29b2f76a", null ], - [ "stbi_load_from_callbacks", "stb__image_8h.html#a95ebc5c42c1a753200be8d465e933af7", null ], - [ "stbi_load_from_file", "stb__image_8h.html#aa9994764695597161e8f3776e97caa99", null ], - [ "stbi_load_from_file_16", "stb__image_8h.html#a9ca2591f0987284129e82bf9dbcf7c6c", null ], - [ "stbi_load_from_memory", "stb__image_8h.html#acae25d31bfae29d75482f07fecf2935f", null ], - [ "stbi_loadf", "stb__image_8h.html#af4f17acd30945a75901fdc022f90575f", null ], - [ "stbi_loadf_from_callbacks", "stb__image_8h.html#a6e7fd261af79ecef2208df3a6cc806bb", null ], - [ "stbi_loadf_from_file", "stb__image_8h.html#ace82446ecd7b5c760cde062179660f46", null ], - [ "stbi_loadf_from_memory", "stb__image_8h.html#a5d47fb76ce1e34eb0729ad932c9c48e2", null ], - [ "stbi_set_flip_vertically_on_load", "stb__image_8h.html#ab89c177fc52f1bb2dc1c05e48129a0a4", null ], - [ "stbi_set_unpremultiply_on_load", "stb__image_8h.html#a3f02e0053e1c8d08a3ed436e6a82c7c9", null ], - [ "stbi_zlib_decode_buffer", "stb__image_8h.html#ae8447830c49bc17f8491e12c1f0ded48", null ], - [ "stbi_zlib_decode_malloc", "stb__image_8h.html#a4919b67b12e0e3acc5301f185ca77e2e", null ], - [ "stbi_zlib_decode_malloc_guesssize", "stb__image_8h.html#aaaa17a529bec51403cc23dc2e7c36d79", null ], - [ "stbi_zlib_decode_malloc_guesssize_headerflag", "stb__image_8h.html#a038b0e741859a482b8b9d60167e54d27", null ], - [ "stbi_zlib_decode_noheader_buffer", "stb__image_8h.html#a0d12efc011adfff7521f3b924feb0b0e", null ], - [ "stbi_zlib_decode_noheader_malloc", "stb__image_8h.html#a7fbd65c83495f13f22469fe493775739", null ] -]; \ No newline at end of file diff --git a/stb__image_8h_source.html b/stb__image_8h_source.html index 18aab9c3..8152bc3b 100644 --- a/stb__image_8h_source.html +++ b/stb__image_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    stb_image.h
    -Go to the documentation of this file.
    1 /* stb_image - v2.16 - public domain image loader - http://nothings.org/stb_image.h
    -
    2  no warranty implied; use at your own risk
    +Go to the documentation of this file.
    1 /* stb_image - v2.16 - public domain image loader -
    +
    2 http://nothings.org/stb_image.h no warranty implied; use at your own risk
    3 
    4  Do this:
    5  #define STB_IMAGE_IMPLEMENTATION
    -
    6  before you include this file in *one* C or C++ file to create the implementation.
    -
    7 
    -
    8  // i.e. it should look like this:
    -
    9  #include ...
    +
    6  before you include this file in *one* C or C++ file to create the
    +
    7 implementation.
    +
    8 
    +
    9  // i.e. it should look like this:
    10  #include ...
    11  #include ...
    -
    12  #define STB_IMAGE_IMPLEMENTATION
    -
    13  #include "stb_image.h"
    -
    14 
    -
    15  You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
    -
    16  And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
    -
    17 
    -
    18 
    -
    19  QUICK NOTES:
    -
    20  Primarily of interest to game developers and other people who can
    -
    21  avoid problematic images and only need the trivial interface
    -
    22 
    -
    23  JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
    -
    24  PNG 1/2/4/8/16-bit-per-channel
    -
    25 
    -
    26  TGA (not sure what subset, if a subset)
    -
    27  BMP non-1bpp, non-RLE
    -
    28  PSD (composited view only, no extra channels, 8/16 bit-per-channel)
    -
    29 
    -
    30  GIF (*comp always reports as 4-channel)
    -
    31  HDR (radiance rgbE format)
    -
    32  PIC (Softimage PIC)
    -
    33  PNM (PPM and PGM binary only)
    -
    34 
    -
    35  Animated GIF still needs a proper API, but here's one way to do it:
    -
    36  http://gist.github.com/urraka/685d9a6340b26b830d49
    -
    37 
    -
    38  - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
    -
    39  - decode from arbitrary I/O callbacks
    -
    40  - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
    -
    41 
    -
    42  Full documentation under "DOCUMENTATION" below.
    +
    12  #include ...
    +
    13  #define STB_IMAGE_IMPLEMENTATION
    +
    14  #include "stb_image.h"
    +
    15 
    +
    16  You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
    +
    17  And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using
    +
    18 malloc,realloc,free
    +
    19 
    +
    20 
    +
    21  QUICK NOTES:
    +
    22  Primarily of interest to game developers and other people who can
    +
    23  avoid problematic images and only need the trivial interface
    +
    24 
    +
    25  JPEG baseline & progressive (12 bpc/arithmetic not supported, same as
    +
    26 stock IJG lib) PNG 1/2/4/8/16-bit-per-channel
    +
    27 
    +
    28  TGA (not sure what subset, if a subset)
    +
    29  BMP non-1bpp, non-RLE
    +
    30  PSD (composited view only, no extra channels, 8/16 bit-per-channel)
    +
    31 
    +
    32  GIF (*comp always reports as 4-channel)
    +
    33  HDR (radiance rgbE format)
    +
    34  PIC (Softimage PIC)
    +
    35  PNM (PPM and PGM binary only)
    +
    36 
    +
    37  Animated GIF still needs a proper API, but here's one way to do it:
    +
    38  http://gist.github.com/urraka/685d9a6340b26b830d49
    +
    39 
    +
    40  - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
    +
    41  - decode from arbitrary I/O callbacks
    +
    42  - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
    43 
    -
    44 
    -
    45 LICENSE
    +
    44  Full documentation under "DOCUMENTATION" below.
    +
    45 
    46 
    -
    47  See end of file for license information.
    +
    47 LICENSE
    48 
    -
    49 RECENT REVISION HISTORY:
    +
    49  See end of file for license information.
    50 
    -
    51  2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes
    -
    52  2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC
    -
    53  2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
    -
    54  2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes
    -
    55  2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
    -
    56  2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64
    -
    57  RGB-format JPEG; remove white matting in PSD;
    -
    58  allocate large structures on the stack;
    -
    59  correct channel count for PNG & BMP
    -
    60  2.10 (2016-01-22) avoid warning introduced in 2.09
    -
    61  2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
    +
    51 RECENT REVISION HISTORY:
    +
    52 
    +
    53  2.16 (2017-07-23) all functions have 16-bit variants; optimizations;
    +
    54 bugfixes 2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE
    +
    55 detection on GCC 2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for
    +
    56 Imagenet JPGs 2.13 (2016-12-04) experimental 16-bit API, only for PNG so far;
    +
    57 fixes 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11
    +
    58 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 RGB-format JPEG; remove
    +
    59 white matting in PSD; allocate large structures on the stack; correct channel
    +
    60 count for PNG & BMP 2.10 (2016-01-22) avoid warning introduced in 2.09 2.09
    +
    61 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
    62 
    63  See end of file for full revision history.
    64 
    @@ -186,55 +170,55 @@ $(document).ready(function(){initNavTree('stb__image_8h_source.html','');});
    76  github:urraka (animated gif) Junggon Kim (PNM comments)
    77  Daniel Gibson (16-bit TGA)
    78  socks-the-fox (16-bit PNG)
    -
    79  Jeremy Sawicki (handle all ImageNet JPGs)
    -
    80  Optimizations & bugfixes
    -
    81  Fabian "ryg" Giesen
    -
    82  Arseny Kapoulkine
    -
    83  John-Mark Allen
    -
    84 
    -
    85  Bug & warning fixes
    -
    86  Marc LeBlanc David Woo Guillaume George Martins Mozeiko
    -
    87  Christpher Lloyd Jerry Jansson Joseph Thomson Phil Jordan
    -
    88  Dave Moore Roy Eltham Hayaki Saito Nathan Reed
    -
    89  Won Chun Luke Graham Johan Duparc Nick Verigakis
    -
    90  the Horde3D community Thomas Ruf Ronny Chevalier Baldur Karlsson
    -
    91  Janez Zemva John Bartholomew Michal Cichon github:rlyeh
    -
    92  Jonathan Blow Ken Hamada Tero Hanninen github:romigrou
    -
    93  Laurent Gomila Cort Stratton Sergio Gonzalez github:svdijk
    -
    94  Aruelien Pocheville Thibault Reuille Cass Everitt github:snagar
    -
    95  Ryamond Barbiero Paul Du Bois Engin Manap github:Zelex
    -
    96  Michaelangel007@github Philipp Wiesemann Dale Weiler github:grim210
    -
    97  Oriol Ferrer Mesia Josh Tobin Matthew Gregan github:sammyhw
    -
    98  Blazej Dariusz Roszkowski Gregory Mullen github:phprus
    -
    99  Christian Floisand Kevin Schmidt github:poppolopoppo
    -
    100 */
    -
    101 
    -
    102 #ifndef STBI_INCLUDE_STB_IMAGE_H
    -
    103 #define STBI_INCLUDE_STB_IMAGE_H
    -
    104 
    -
    105 // DOCUMENTATION
    -
    106 //
    -
    107 // Limitations:
    -
    108 // - no 16-bit-per-channel PNG
    -
    109 // - no 12-bit-per-channel JPEG
    -
    110 // - no JPEGs with arithmetic coding
    -
    111 // - no 1-bit BMP
    -
    112 // - GIF always returns *comp=4
    -
    113 //
    -
    114 // Basic usage (see HDR discussion below for HDR usage):
    -
    115 // int x,y,n;
    -
    116 // unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
    -
    117 // // ... process data if not NULL ...
    -
    118 // // ... x = width, y = height, n = # 8-bit components per pixel ...
    -
    119 // // ... replace '0' with '1'..'4' to force that many components per pixel
    -
    120 // // ... but 'n' will always be the number that it would have been if you said 0
    -
    121 // stbi_image_free(data)
    -
    122 //
    -
    123 // Standard parameters:
    -
    124 // int *x -- outputs image width in pixels
    -
    125 // int *y -- outputs image height in pixels
    -
    126 // int *channels_in_file -- outputs # of image components in image file
    -
    127 // int desired_channels -- if non-zero, # of image components requested in result
    +
    79  Jeremy Sawicki (handle all ImageNet
    +
    80 JPGs) Optimizations & bugfixes Fabian "ryg" Giesen Arseny Kapoulkine John-Mark
    +
    81 Allen
    +
    82 
    +
    83  Bug & warning fixes
    +
    84  Marc LeBlanc David Woo Guillaume George Martins
    +
    85 Mozeiko Christpher Lloyd Jerry Jansson Joseph Thomson Phil
    +
    86 Jordan Dave Moore Roy Eltham Hayaki Saito Nathan Reed
    +
    87  Won Chun Luke Graham Johan Duparc Nick Verigakis
    +
    88  the Horde3D community Thomas Ruf Ronny Chevalier Baldur
    +
    89 Karlsson Janez Zemva John Bartholomew Michal Cichon
    +
    90 github:rlyeh Jonathan Blow Ken Hamada Tero Hanninen
    +
    91 github:romigrou Laurent Gomila Cort Stratton Sergio Gonzalez
    +
    92 github:svdijk Aruelien Pocheville Thibault Reuille Cass Everitt
    +
    93 github:snagar Ryamond Barbiero Paul Du Bois Engin Manap
    +
    94 github:Zelex Michaelangel007@github Philipp Wiesemann Dale Weiler
    +
    95 github:grim210 Oriol Ferrer Mesia Josh Tobin Matthew Gregan
    +
    96 github:sammyhw Blazej Dariusz Roszkowski Gregory Mullen
    +
    97 github:phprus Christian Floisand Kevin Schmidt
    +
    98 github:poppolopoppo
    +
    99 */
    +
    100 
    +
    101 #ifndef STBI_INCLUDE_STB_IMAGE_H
    +
    102 #define STBI_INCLUDE_STB_IMAGE_H
    +
    103 
    +
    104 // DOCUMENTATION
    +
    105 //
    +
    106 // Limitations:
    +
    107 // - no 16-bit-per-channel PNG
    +
    108 // - no 12-bit-per-channel JPEG
    +
    109 // - no JPEGs with arithmetic coding
    +
    110 // - no 1-bit BMP
    +
    111 // - GIF always returns *comp=4
    +
    112 //
    +
    113 // Basic usage (see HDR discussion below for HDR usage):
    +
    114 // int x,y,n;
    +
    115 // unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
    +
    116 // // ... process data if not NULL ...
    +
    117 // // ... x = width, y = height, n = # 8-bit components per pixel ...
    +
    118 // // ... replace '0' with '1'..'4' to force that many components per pixel
    +
    119 // // ... but 'n' will always be the number that it would have been if you
    +
    120 // said 0 stbi_image_free(data)
    +
    121 //
    +
    122 // Standard parameters:
    +
    123 // int *x -- outputs image width in pixels
    +
    124 // int *y -- outputs image height in pixels
    +
    125 // int *channels_in_file -- outputs # of image components in image file
    +
    126 // int desired_channels -- if non-zero, # of image components requested in
    +
    127 // result
    128 //
    129 // The return value from an image loader is an 'unsigned char *' which points
    130 // to the pixel data, or NULL on an allocation failure or if the image is
    @@ -262,8 +246,8 @@ $(document).ready(function(){initNavTree('stb__image_8h_source.html','');});
    152 // and *x, *y, *channels_in_file will be unchanged. The function
    153 // stbi_failure_reason() can be queried for an extremely brief, end-user
    154 // unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS
    -
    155 // to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
    -
    156 // more user-friendly ones.
    +
    155 // to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get
    +
    156 // slightly more user-friendly ones.
    157 //
    158 // Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
    159 //
    @@ -277,154 +261,154 @@ $(document).ready(function(){initNavTree('stb__image_8h_source.html','');});
    167 // 2. easy to maintain
    168 // 3. good performance
    169 //
    -
    170 // Sometimes I let "good performance" creep up in priority over "easy to maintain",
    -
    171 // and for best performance I may provide less-easy-to-use APIs that give higher
    -
    172 // performance, in addition to the easy to use ones. Nevertheless, it's important
    -
    173 // to keep in mind that from the standpoint of you, a client of this library,
    -
    174 // all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all.
    -
    175 //
    -
    176 // Some secondary priorities arise directly from the first two, some of which
    -
    177 // make more explicit reasons why performance can't be emphasized.
    -
    178 //
    -
    179 // - Portable ("ease of use")
    -
    180 // - Small source code footprint ("easy to maintain")
    -
    181 // - No dependencies ("ease of use")
    -
    182 //
    -
    183 // ===========================================================================
    -
    184 //
    -
    185 // I/O callbacks
    -
    186 //
    -
    187 // I/O callbacks allow you to read from arbitrary sources, like packaged
    -
    188 // files or some other source. Data read from callbacks are processed
    -
    189 // through a small internal buffer (currently 128 bytes) to try to reduce
    -
    190 // overhead.
    -
    191 //
    -
    192 // The three functions you must define are "read" (reads some bytes of data),
    -
    193 // "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
    -
    194 //
    -
    195 // ===========================================================================
    +
    170 // Sometimes I let "good performance" creep up in priority over "easy to
    +
    171 // maintain", and for best performance I may provide less-easy-to-use APIs that
    +
    172 // give higher performance, in addition to the easy to use ones. Nevertheless,
    +
    173 // it's important to keep in mind that from the standpoint of you, a client of
    +
    174 // this library, all you care about is #1 and #3, and stb libraries DO NOT
    +
    175 // emphasize #3 above all.
    +
    176 //
    +
    177 // Some secondary priorities arise directly from the first two, some of which
    +
    178 // make more explicit reasons why performance can't be emphasized.
    +
    179 //
    +
    180 // - Portable ("ease of use")
    +
    181 // - Small source code footprint ("easy to maintain")
    +
    182 // - No dependencies ("ease of use")
    +
    183 //
    +
    184 // ===========================================================================
    +
    185 //
    +
    186 // I/O callbacks
    +
    187 //
    +
    188 // I/O callbacks allow you to read from arbitrary sources, like packaged
    +
    189 // files or some other source. Data read from callbacks are processed
    +
    190 // through a small internal buffer (currently 128 bytes) to try to reduce
    +
    191 // overhead.
    +
    192 //
    +
    193 // The three functions you must define are "read" (reads some bytes of data),
    +
    194 // "skip" (skips some bytes of data), "eof" (reports if the stream is at the
    +
    195 // end).
    196 //
    -
    197 // SIMD support
    +
    197 // ===========================================================================
    198 //
    -
    199 // The JPEG decoder will try to automatically use SIMD kernels on x86 when
    -
    200 // supported by the compiler. For ARM Neon support, you must explicitly
    -
    201 // request it.
    -
    202 //
    -
    203 // (The old do-it-yourself SIMD API is no longer supported in the current
    -
    204 // code.)
    -
    205 //
    -
    206 // On x86, SSE2 will automatically be used when available based on a run-time
    -
    207 // test; if not, the generic C versions are used as a fall-back. On ARM targets,
    -
    208 // the typical path is to have separate builds for NEON and non-NEON devices
    -
    209 // (at least this is true for iOS and Android). Therefore, the NEON support is
    -
    210 // toggled by a build flag: define STBI_NEON to get NEON loops.
    -
    211 //
    -
    212 // If for some reason you do not want to use any of SIMD code, or if
    -
    213 // you have issues compiling it, you can disable it entirely by
    -
    214 // defining STBI_NO_SIMD.
    -
    215 //
    -
    216 // ===========================================================================
    +
    199 // SIMD support
    +
    200 //
    +
    201 // The JPEG decoder will try to automatically use SIMD kernels on x86 when
    +
    202 // supported by the compiler. For ARM Neon support, you must explicitly
    +
    203 // request it.
    +
    204 //
    +
    205 // (The old do-it-yourself SIMD API is no longer supported in the current
    +
    206 // code.)
    +
    207 //
    +
    208 // On x86, SSE2 will automatically be used when available based on a run-time
    +
    209 // test; if not, the generic C versions are used as a fall-back. On ARM targets,
    +
    210 // the typical path is to have separate builds for NEON and non-NEON devices
    +
    211 // (at least this is true for iOS and Android). Therefore, the NEON support is
    +
    212 // toggled by a build flag: define STBI_NEON to get NEON loops.
    +
    213 //
    +
    214 // If for some reason you do not want to use any of SIMD code, or if
    +
    215 // you have issues compiling it, you can disable it entirely by
    +
    216 // defining STBI_NO_SIMD.
    217 //
    -
    218 // HDR image support (disable by defining STBI_NO_HDR)
    +
    218 // ===========================================================================
    219 //
    -
    220 // stb_image now supports loading HDR images in general, and currently
    -
    221 // the Radiance .HDR file format, although the support is provided
    -
    222 // generically. You can still load any file through the existing interface;
    -
    223 // if you attempt to load an HDR file, it will be automatically remapped to
    -
    224 // LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
    -
    225 // both of these constants can be reconfigured through this interface:
    -
    226 //
    -
    227 // stbi_hdr_to_ldr_gamma(2.2f);
    -
    228 // stbi_hdr_to_ldr_scale(1.0f);
    -
    229 //
    -
    230 // (note, do not use _inverse_ constants; stbi_image will invert them
    -
    231 // appropriately).
    -
    232 //
    -
    233 // Additionally, there is a new, parallel interface for loading files as
    -
    234 // (linear) floats to preserve the full dynamic range:
    -
    235 //
    -
    236 // float *data = stbi_loadf(filename, &x, &y, &n, 0);
    +
    220 // HDR image support (disable by defining STBI_NO_HDR)
    +
    221 //
    +
    222 // stb_image now supports loading HDR images in general, and currently
    +
    223 // the Radiance .HDR file format, although the support is provided
    +
    224 // generically. You can still load any file through the existing interface;
    +
    225 // if you attempt to load an HDR file, it will be automatically remapped to
    +
    226 // LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
    +
    227 // both of these constants can be reconfigured through this interface:
    +
    228 //
    +
    229 // stbi_hdr_to_ldr_gamma(2.2f);
    +
    230 // stbi_hdr_to_ldr_scale(1.0f);
    +
    231 //
    +
    232 // (note, do not use _inverse_ constants; stbi_image will invert them
    +
    233 // appropriately).
    +
    234 //
    +
    235 // Additionally, there is a new, parallel interface for loading files as
    +
    236 // (linear) floats to preserve the full dynamic range:
    237 //
    -
    238 // If you load LDR images through this interface, those images will
    -
    239 // be promoted to floating point values, run through the inverse of
    -
    240 // constants corresponding to the above:
    -
    241 //
    -
    242 // stbi_ldr_to_hdr_scale(1.0f);
    -
    243 // stbi_ldr_to_hdr_gamma(2.2f);
    -
    244 //
    -
    245 // Finally, given a filename (or an open file or memory block--see header
    -
    246 // file for details) containing image data, you can query for the "most
    -
    247 // appropriate" interface to use (that is, whether the image is HDR or
    -
    248 // not), using:
    -
    249 //
    -
    250 // stbi_is_hdr(char *filename);
    +
    238 // float *data = stbi_loadf(filename, &x, &y, &n, 0);
    +
    239 //
    +
    240 // If you load LDR images through this interface, those images will
    +
    241 // be promoted to floating point values, run through the inverse of
    +
    242 // constants corresponding to the above:
    +
    243 //
    +
    244 // stbi_ldr_to_hdr_scale(1.0f);
    +
    245 // stbi_ldr_to_hdr_gamma(2.2f);
    +
    246 //
    +
    247 // Finally, given a filename (or an open file or memory block--see header
    +
    248 // file for details) containing image data, you can query for the "most
    +
    249 // appropriate" interface to use (that is, whether the image is HDR or
    +
    250 // not), using:
    251 //
    -
    252 // ===========================================================================
    +
    252 // stbi_is_hdr(char *filename);
    253 //
    -
    254 // iPhone PNG support:
    +
    254 // ===========================================================================
    255 //
    -
    256 // By default we convert iphone-formatted PNGs back to RGB, even though
    -
    257 // they are internally encoded differently. You can disable this conversion
    -
    258 // by by calling stbi_convert_iphone_png_to_rgb(0), in which case
    -
    259 // you will always just get the native iphone "format" through (which
    -
    260 // is BGR stored in RGB).
    -
    261 //
    -
    262 // Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
    -
    263 // pixel to remove any premultiplied alpha *only* if the image file explicitly
    -
    264 // says there's premultiplied data (currently only happens in iPhone images,
    -
    265 // and only if iPhone convert-to-rgb processing is on).
    -
    266 //
    -
    267 // ===========================================================================
    +
    256 // iPhone PNG support:
    +
    257 //
    +
    258 // By default we convert iphone-formatted PNGs back to RGB, even though
    +
    259 // they are internally encoded differently. You can disable this conversion
    +
    260 // by by calling stbi_convert_iphone_png_to_rgb(0), in which case
    +
    261 // you will always just get the native iphone "format" through (which
    +
    262 // is BGR stored in RGB).
    +
    263 //
    +
    264 // Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
    +
    265 // pixel to remove any premultiplied alpha *only* if the image file explicitly
    +
    266 // says there's premultiplied data (currently only happens in iPhone images,
    +
    267 // and only if iPhone convert-to-rgb processing is on).
    268 //
    -
    269 // ADDITIONAL CONFIGURATION
    +
    269 // ===========================================================================
    270 //
    -
    271 // - You can suppress implementation of any of the decoders to reduce
    -
    272 // your code footprint by #defining one or more of the following
    -
    273 // symbols before creating the implementation.
    -
    274 //
    -
    275 // STBI_NO_JPEG
    -
    276 // STBI_NO_PNG
    -
    277 // STBI_NO_BMP
    -
    278 // STBI_NO_PSD
    -
    279 // STBI_NO_TGA
    -
    280 // STBI_NO_GIF
    -
    281 // STBI_NO_HDR
    -
    282 // STBI_NO_PIC
    -
    283 // STBI_NO_PNM (.ppm and .pgm)
    -
    284 //
    -
    285 // - You can request *only* certain decoders and suppress all other ones
    -
    286 // (this will be more forward-compatible, as addition of new decoders
    -
    287 // doesn't require you to disable them explicitly):
    -
    288 //
    -
    289 // STBI_ONLY_JPEG
    -
    290 // STBI_ONLY_PNG
    -
    291 // STBI_ONLY_BMP
    -
    292 // STBI_ONLY_PSD
    -
    293 // STBI_ONLY_TGA
    -
    294 // STBI_ONLY_GIF
    -
    295 // STBI_ONLY_HDR
    -
    296 // STBI_ONLY_PIC
    -
    297 // STBI_ONLY_PNM (.ppm and .pgm)
    -
    298 //
    -
    299 // - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
    -
    300 // want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
    -
    301 //
    -
    302 
    -
    303 
    -
    304 #ifndef STBI_NO_STDIO
    -
    305 #include <stdio.h>
    -
    306 #endif // STBI_NO_STDIO
    -
    307 
    -
    308 #define STBI_VERSION 1
    -
    309 
    -
    310 enum
    -
    311 {
    -
    312  STBI_default = 0, // only used for desired_channels
    +
    271 // ADDITIONAL CONFIGURATION
    +
    272 //
    +
    273 // - You can suppress implementation of any of the decoders to reduce
    +
    274 // your code footprint by #defining one or more of the following
    +
    275 // symbols before creating the implementation.
    +
    276 //
    +
    277 // STBI_NO_JPEG
    +
    278 // STBI_NO_PNG
    +
    279 // STBI_NO_BMP
    +
    280 // STBI_NO_PSD
    +
    281 // STBI_NO_TGA
    +
    282 // STBI_NO_GIF
    +
    283 // STBI_NO_HDR
    +
    284 // STBI_NO_PIC
    +
    285 // STBI_NO_PNM (.ppm and .pgm)
    +
    286 //
    +
    287 // - You can request *only* certain decoders and suppress all other ones
    +
    288 // (this will be more forward-compatible, as addition of new decoders
    +
    289 // doesn't require you to disable them explicitly):
    +
    290 //
    +
    291 // STBI_ONLY_JPEG
    +
    292 // STBI_ONLY_PNG
    +
    293 // STBI_ONLY_BMP
    +
    294 // STBI_ONLY_PSD
    +
    295 // STBI_ONLY_TGA
    +
    296 // STBI_ONLY_GIF
    +
    297 // STBI_ONLY_HDR
    +
    298 // STBI_ONLY_PIC
    +
    299 // STBI_ONLY_PNM (.ppm and .pgm)
    +
    300 //
    +
    301 // - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
    +
    302 // want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
    +
    303 //
    +
    304 
    +
    305 #ifndef STBI_NO_STDIO
    +
    306 #include <stdio.h>
    +
    307 #endif // STBI_NO_STDIO
    +
    308 
    +
    309 #define STBI_VERSION 1
    +
    310 
    +
    311 enum {
    +
    312  STBI_default = 0, // only used for desired_channels
    313 
    - - -
    316  STBI_rgb = 3,
    - + + +
    316  STBI_rgb = 3,
    +
    318 };
    319 
    320 typedef unsigned char stbi_uc;
    @@ -448,6844 +432,7814 @@ $(document).ready(function(){initNavTree('stb__image_8h_source.html','');});
    339 // load image by filename, open file, or memory buffer
    340 //
    341 
    -
    342 typedef struct
    -
    343 {
    -
    344  int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
    -
    345  void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
    -
    346  int (*eof) (void *user); // returns nonzero if we are at end of file/data
    - -
    348 
    -
    350 //
    -
    351 // 8-bits-per-channel interface
    +
    342 typedef struct {
    +
    343  int (*read)(void *user, char *data, int size); // fill 'data' with 'size'
    +
    344  // bytes. return number of
    +
    345  // bytes actually read
    +
    346  void (*skip)(void *user, int n); // skip the next 'n' bytes, or 'unget' the
    +
    347  // last -n bytes if negative
    +
    348  int (*eof)(void *user); // returns nonzero if we are at end of file/data
    + +
    350 
    352 //
    -
    353 
    -
    354 STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels);
    -
    355 STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    356 
    -
    357 #ifndef STBI_NO_STDIO
    -
    358 STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    359 STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    360 // for stbi_load_from_file, file pointer is left pointing immediately after image
    -
    361 #endif
    -
    362 
    -
    364 //
    -
    365 // 16-bits-per-channel interface
    -
    366 //
    -
    367 
    -
    368 STBIDEF stbi_us *stbi_load_16_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    369 STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    370 
    -
    371 #ifndef STBI_NO_STDIO
    -
    372 STBIDEF stbi_us *stbi_load_16 (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    373 STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    374 #endif
    -
    375 
    +
    353 // 8-bits-per-channel interface
    +
    354 //
    +
    355 
    +
    356 STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    357  int *y, int *channels_in_file,
    +
    358  int desired_channels);
    + +
    360  void *user, int *x, int *y,
    +
    361  int *channels_in_file,
    +
    362  int desired_channels);
    +
    363 
    +
    364 #ifndef STBI_NO_STDIO
    +
    365 STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y,
    +
    366  int *channels_in_file, int desired_channels);
    +
    367 STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y,
    +
    368  int *channels_in_file,
    +
    369  int desired_channels);
    +
    370 // for stbi_load_from_file, file pointer is left pointing immediately after
    +
    371 // image
    +
    372 #endif
    +
    373 
    +
    375 //
    +
    376 // 16-bits-per-channel interface
    377 //
    -
    378 // float-per-channel interface
    -
    379 //
    -
    380 #ifndef STBI_NO_LINEAR
    -
    381  STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    382  STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    383 
    -
    384  #ifndef STBI_NO_STDIO
    -
    385  STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    386  STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
    -
    387  #endif
    -
    388 #endif
    -
    389 
    -
    390 #ifndef STBI_NO_HDR
    -
    391  STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
    -
    392  STBIDEF void stbi_hdr_to_ldr_scale(float scale);
    -
    393 #endif // STBI_NO_HDR
    +
    378 
    +
    379 STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len,
    +
    380  int *x, int *y, int *channels_in_file,
    +
    381  int desired_channels);
    + +
    383  void *user, int *x, int *y,
    +
    384  int *channels_in_file,
    +
    385  int desired_channels);
    +
    386 
    +
    387 #ifndef STBI_NO_STDIO
    +
    388 STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y,
    +
    389  int *channels_in_file, int desired_channels);
    +
    390 STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y,
    +
    391  int *channels_in_file,
    +
    392  int desired_channels);
    +
    393 #endif
    394 
    -
    395 #ifndef STBI_NO_LINEAR
    -
    396  STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
    -
    397  STBIDEF void stbi_ldr_to_hdr_scale(float scale);
    -
    398 #endif // STBI_NO_LINEAR
    -
    399 
    -
    400 // stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
    -
    401 STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
    -
    402 STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
    -
    403 #ifndef STBI_NO_STDIO
    -
    404 STBIDEF int stbi_is_hdr (char const *filename);
    -
    405 STBIDEF int stbi_is_hdr_from_file(FILE *f);
    -
    406 #endif // STBI_NO_STDIO
    -
    407 
    -
    408 
    -
    409 // get a VERY brief reason for failure
    -
    410 // NOT THREADSAFE
    -
    411 STBIDEF const char *stbi_failure_reason (void);
    -
    412 
    -
    413 // free the loaded image -- this is just free()
    -
    414 STBIDEF void stbi_image_free (void *retval_from_stbi_load);
    -
    415 
    -
    416 // get image dimensions & components without fully decoding
    -
    417 STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
    -
    418 STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
    -
    419 
    -
    420 #ifndef STBI_NO_STDIO
    -
    421 STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp);
    -
    422 STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);
    -
    423 
    -
    424 #endif
    -
    425 
    -
    426 
    -
    427 
    -
    428 // for image formats that explicitly notate that they have premultiplied alpha,
    -
    429 // we just return the colors as stored in the file. set this flag to force
    -
    430 // unpremultiplication. results are undefined if the unpremultiply overflow.
    -
    431 STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
    -
    432 
    -
    433 // indicate whether we should process iphone images back to canonical format,
    -
    434 // or just pass them through "as-is"
    -
    435 STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
    -
    436 
    -
    437 // flip the image vertically, so the first pixel in the output array is the bottom left
    -
    438 STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
    +
    396 //
    +
    397 // float-per-channel interface
    +
    398 //
    +
    399 #ifndef STBI_NO_LINEAR
    +
    400 STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    401  int *y, int *channels_in_file,
    +
    402  int desired_channels);
    + +
    404  void *user, int *x, int *y,
    +
    405  int *channels_in_file,
    +
    406  int desired_channels);
    +
    407 
    +
    408 #ifndef STBI_NO_STDIO
    +
    409 STBIDEF float *stbi_loadf(char const *filename, int *x, int *y,
    +
    410  int *channels_in_file, int desired_channels);
    +
    411 STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y,
    +
    412  int *channels_in_file,
    +
    413  int desired_channels);
    +
    414 #endif
    +
    415 #endif
    +
    416 
    +
    417 #ifndef STBI_NO_HDR
    +
    418 STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
    +
    419 STBIDEF void stbi_hdr_to_ldr_scale(float scale);
    +
    420 #endif // STBI_NO_HDR
    +
    421 
    +
    422 #ifndef STBI_NO_LINEAR
    +
    423 STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
    +
    424 STBIDEF void stbi_ldr_to_hdr_scale(float scale);
    +
    425 #endif // STBI_NO_LINEAR
    +
    426 
    +
    427 // stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
    + +
    429  void *user);
    +
    430 STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
    +
    431 #ifndef STBI_NO_STDIO
    +
    432 STBIDEF int stbi_is_hdr(char const *filename);
    +
    433 STBIDEF int stbi_is_hdr_from_file(FILE *f);
    +
    434 #endif // STBI_NO_STDIO
    +
    435 
    +
    436 // get a VERY brief reason for failure
    +
    437 // NOT THREADSAFE
    +
    438 STBIDEF const char *stbi_failure_reason(void);
    439 
    -
    440 // ZLIB client - used by PNG, available for other purposes
    -
    441 
    -
    442 STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
    -
    443 STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);
    -
    444 STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
    -
    445 STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
    -
    446 
    -
    447 STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
    -
    448 STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
    -
    449 
    -
    450 
    -
    451 #ifdef __cplusplus
    -
    452 }
    +
    440 // free the loaded image -- this is just free()
    +
    441 STBIDEF void stbi_image_free(void *retval_from_stbi_load);
    +
    442 
    +
    443 // get image dimensions & components without fully decoding
    +
    444 STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    445  int *y, int *comp);
    +
    446 STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user,
    +
    447  int *x, int *y, int *comp);
    +
    448 
    +
    449 #ifndef STBI_NO_STDIO
    +
    450 STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp);
    +
    451 STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp);
    +
    452 
    453 #endif
    454 
    -
    455 //
    -
    456 //
    -
    458 #endif // STBI_INCLUDE_STB_IMAGE_H
    -
    459 
    -
    460 #ifdef STB_IMAGE_IMPLEMENTATION
    -
    461 
    -
    462 #if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
    -
    463  || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
    -
    464  || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
    -
    465  || defined(STBI_ONLY_ZLIB)
    -
    466  #ifndef STBI_ONLY_JPEG
    -
    467  #define STBI_NO_JPEG
    -
    468  #endif
    -
    469  #ifndef STBI_ONLY_PNG
    -
    470  #define STBI_NO_PNG
    -
    471  #endif
    -
    472  #ifndef STBI_ONLY_BMP
    -
    473  #define STBI_NO_BMP
    -
    474  #endif
    -
    475  #ifndef STBI_ONLY_PSD
    -
    476  #define STBI_NO_PSD
    -
    477  #endif
    -
    478  #ifndef STBI_ONLY_TGA
    -
    479  #define STBI_NO_TGA
    -
    480  #endif
    -
    481  #ifndef STBI_ONLY_GIF
    -
    482  #define STBI_NO_GIF
    -
    483  #endif
    -
    484  #ifndef STBI_ONLY_HDR
    -
    485  #define STBI_NO_HDR
    -
    486  #endif
    -
    487  #ifndef STBI_ONLY_PIC
    -
    488  #define STBI_NO_PIC
    -
    489  #endif
    -
    490  #ifndef STBI_ONLY_PNM
    -
    491  #define STBI_NO_PNM
    -
    492  #endif
    -
    493 #endif
    -
    494 
    -
    495 #if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)
    -
    496 #define STBI_NO_ZLIB
    -
    497 #endif
    -
    498 
    -
    499 
    -
    500 #include <stdarg.h>
    -
    501 #include <stddef.h> // ptrdiff_t on osx
    -
    502 #include <stdlib.h>
    -
    503 #include <string.h>
    -
    504 #include <limits.h>
    -
    505 
    -
    506 #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
    -
    507 #include <math.h> // ldexp
    -
    508 #endif
    -
    509 
    -
    510 #ifndef STBI_NO_STDIO
    -
    511 #include <stdio.h>
    -
    512 #endif
    -
    513 
    -
    514 #ifndef STBI_ASSERT
    -
    515 #include <assert.h>
    -
    516 #define STBI_ASSERT(x) assert(x)
    +
    455 // for image formats that explicitly notate that they have premultiplied alpha,
    +
    456 // we just return the colors as stored in the file. set this flag to force
    +
    457 // unpremultiplication. results are undefined if the unpremultiply overflow.
    +
    458 STBIDEF void
    +
    459 stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
    +
    460 
    +
    461 // indicate whether we should process iphone images back to canonical format,
    +
    462 // or just pass them through "as-is"
    +
    463 STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
    +
    464 
    +
    465 // flip the image vertically, so the first pixel in the output array is the
    +
    466 // bottom left
    +
    467 STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
    +
    468 
    +
    469 // ZLIB client - used by PNG, available for other purposes
    +
    470 
    +
    471 STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len,
    +
    472  int initial_size, int *outlen);
    + +
    474  int len,
    +
    475  int initial_size,
    +
    476  int *outlen,
    +
    477  int parse_header);
    +
    478 STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
    +
    479 STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen,
    +
    480  const char *ibuffer, int ilen);
    +
    481 
    +
    482 STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len,
    +
    483  int *outlen);
    +
    484 STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen,
    +
    485  const char *ibuffer, int ilen);
    +
    486 
    +
    487 #ifdef __cplusplus
    +
    488 }
    +
    489 #endif
    +
    490 
    +
    491 //
    +
    492 //
    +
    494 #endif // STBI_INCLUDE_STB_IMAGE_H
    +
    495 
    +
    496 #ifdef STB_IMAGE_IMPLEMENTATION
    +
    497 
    +
    498 #if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || \
    +
    499  defined(STBI_ONLY_BMP) || defined(STBI_ONLY_TGA) || \
    +
    500  defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) || \
    +
    501  defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || \
    +
    502  defined(STBI_ONLY_PNM) || defined(STBI_ONLY_ZLIB)
    +
    503 #ifndef STBI_ONLY_JPEG
    +
    504 #define STBI_NO_JPEG
    +
    505 #endif
    +
    506 #ifndef STBI_ONLY_PNG
    +
    507 #define STBI_NO_PNG
    +
    508 #endif
    +
    509 #ifndef STBI_ONLY_BMP
    +
    510 #define STBI_NO_BMP
    +
    511 #endif
    +
    512 #ifndef STBI_ONLY_PSD
    +
    513 #define STBI_NO_PSD
    +
    514 #endif
    +
    515 #ifndef STBI_ONLY_TGA
    +
    516 #define STBI_NO_TGA
    517 #endif
    -
    518 
    -
    519 
    -
    520 #ifndef _MSC_VER
    -
    521  #ifdef __cplusplus
    -
    522  #define stbi_inline inline
    -
    523  #else
    -
    524  #define stbi_inline
    -
    525  #endif
    -
    526 #else
    -
    527  #define stbi_inline __forceinline
    -
    528 #endif
    -
    529 
    -
    530 
    -
    531 #ifdef _MSC_VER
    -
    532 typedef unsigned short stbi__uint16;
    -
    533 typedef signed short stbi__int16;
    -
    534 typedef unsigned int stbi__uint32;
    -
    535 typedef signed int stbi__int32;
    -
    536 #else
    -
    537 #include <stdint.h>
    -
    538 typedef uint16_t stbi__uint16;
    -
    539 typedef int16_t stbi__int16;
    -
    540 typedef uint32_t stbi__uint32;
    -
    541 typedef int32_t stbi__int32;
    -
    542 #endif
    -
    543 
    -
    544 // should produce compiler error if size is wrong
    -
    545 typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
    -
    546 
    -
    547 #ifdef _MSC_VER
    -
    548 #define STBI_NOTUSED(v) (void)(v)
    -
    549 #else
    -
    550 #define STBI_NOTUSED(v) (void)sizeof(v)
    -
    551 #endif
    -
    552 
    -
    553 #ifdef _MSC_VER
    -
    554 #define STBI_HAS_LROTL
    -
    555 #endif
    -
    556 
    -
    557 #ifdef STBI_HAS_LROTL
    -
    558  #define stbi_lrot(x,y) _lrotl(x,y)
    +
    518 #ifndef STBI_ONLY_GIF
    +
    519 #define STBI_NO_GIF
    +
    520 #endif
    +
    521 #ifndef STBI_ONLY_HDR
    +
    522 #define STBI_NO_HDR
    +
    523 #endif
    +
    524 #ifndef STBI_ONLY_PIC
    +
    525 #define STBI_NO_PIC
    +
    526 #endif
    +
    527 #ifndef STBI_ONLY_PNM
    +
    528 #define STBI_NO_PNM
    +
    529 #endif
    +
    530 #endif
    +
    531 
    +
    532 #if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && \
    +
    533  !defined(STBI_NO_ZLIB)
    +
    534 #define STBI_NO_ZLIB
    +
    535 #endif
    +
    536 
    +
    537 #include <limits.h>
    +
    538 #include <stdarg.h>
    +
    539 #include <stddef.h> // ptrdiff_t on osx
    +
    540 #include <stdlib.h>
    +
    541 #include <string.h>
    +
    542 
    +
    543 #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
    +
    544 #include <math.h> // ldexp
    +
    545 #endif
    +
    546 
    +
    547 #ifndef STBI_NO_STDIO
    +
    548 #include <stdio.h>
    +
    549 #endif
    +
    550 
    +
    551 #ifndef STBI_ASSERT
    +
    552 #include <assert.h>
    +
    553 #define STBI_ASSERT(x) assert(x)
    +
    554 #endif
    +
    555 
    +
    556 #ifndef _MSC_VER
    +
    557 #ifdef __cplusplus
    +
    558 #define stbi_inline inline
    559 #else
    -
    560  #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
    +
    560 #define stbi_inline
    561 #endif
    -
    562 
    -
    563 #if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED))
    -
    564 // ok
    -
    565 #elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED)
    -
    566 // ok
    -
    567 #else
    -
    568 #error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)."
    -
    569 #endif
    -
    570 
    -
    571 #ifndef STBI_MALLOC
    -
    572 #define STBI_MALLOC(sz) malloc(sz)
    -
    573 #define STBI_REALLOC(p,newsz) realloc(p,newsz)
    -
    574 #define STBI_FREE(p) free(p)
    -
    575 #endif
    -
    576 
    -
    577 #ifndef STBI_REALLOC_SIZED
    -
    578 #define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz)
    -
    579 #endif
    -
    580 
    -
    581 // x86/x64 detection
    -
    582 #if defined(__x86_64__) || defined(_M_X64)
    -
    583 #define STBI__X64_TARGET
    -
    584 #elif defined(__i386) || defined(_M_IX86)
    -
    585 #define STBI__X86_TARGET
    +
    562 #else
    +
    563 #define stbi_inline __forceinline
    +
    564 #endif
    +
    565 
    +
    566 #ifdef _MSC_VER
    +
    567 typedef unsigned short stbi__uint16;
    +
    568 typedef signed short stbi__int16;
    +
    569 typedef unsigned int stbi__uint32;
    +
    570 typedef signed int stbi__int32;
    +
    571 #else
    +
    572 #include <stdint.h>
    +
    573 typedef uint16_t stbi__uint16;
    +
    574 typedef int16_t stbi__int16;
    +
    575 typedef uint32_t stbi__uint32;
    +
    576 typedef int32_t stbi__int32;
    +
    577 #endif
    +
    578 
    +
    579 // should produce compiler error if size is wrong
    +
    580 typedef unsigned char validate_uint32[sizeof(stbi__uint32) == 4 ? 1 : -1];
    +
    581 
    +
    582 #ifdef _MSC_VER
    +
    583 #define STBI_NOTUSED(v) (void)(v)
    +
    584 #else
    +
    585 #define STBI_NOTUSED(v) (void)sizeof(v)
    586 #endif
    587 
    -
    588 #if defined(__GNUC__) && defined(STBI__X86_TARGET) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)
    -
    589 // gcc doesn't support sse2 intrinsics unless you compile with -msse2,
    -
    590 // which in turn means it gets to use SSE2 everywhere. This is unfortunate,
    -
    591 // but previous attempts to provide the SSE2 functions with runtime
    -
    592 // detection caused numerous issues. The way architecture extensions are
    -
    593 // exposed in GCC/Clang is, sadly, not really suited for one-file libs.
    -
    594 // New behavior: if compiled with -msse2, we use SSE2 without any
    -
    595 // detection; if not, we don't use it at all.
    -
    596 #define STBI_NO_SIMD
    -
    597 #endif
    -
    598 
    -
    599 #if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)
    -
    600 // Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET
    -
    601 //
    -
    602 // 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the
    -
    603 // Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.
    -
    604 // As a result, enabling SSE2 on 32-bit MinGW is dangerous when not
    -
    605 // simultaneously enabling "-mstackrealign".
    -
    606 //
    -
    607 // See https://github.com/nothings/stb/issues/81 for more information.
    -
    608 //
    -
    609 // So default to no SSE2 on 32-bit MinGW. If you've read this far and added
    -
    610 // -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2.
    -
    611 #define STBI_NO_SIMD
    -
    612 #endif
    -
    613 
    -
    614 #if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET))
    -
    615 #define STBI_SSE2
    -
    616 #include <emmintrin.h>
    -
    617 
    -
    618 #ifdef _MSC_VER
    -
    619 
    -
    620 #if _MSC_VER >= 1400 // not VC6
    -
    621 #include <intrin.h> // __cpuid
    -
    622 static int stbi__cpuid3(void)
    -
    623 {
    -
    624  int info[4];
    -
    625  __cpuid(info,1);
    -
    626  return info[3];
    -
    627 }
    -
    628 #else
    -
    629 static int stbi__cpuid3(void)
    -
    630 {
    -
    631  int res;
    -
    632  __asm {
    -
    633  mov eax,1
    -
    634  cpuid
    -
    635  mov res,edx
    -
    636  }
    -
    637  return res;
    -
    638 }
    -
    639 #endif
    -
    640 
    -
    641 #define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name
    -
    642 
    -
    643 static int stbi__sse2_available(void)
    -
    644 {
    -
    645  int info3 = stbi__cpuid3();
    -
    646  return ((info3 >> 26) & 1) != 0;
    -
    647 }
    -
    648 #else // assume GCC-style if not VC++
    -
    649 #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
    -
    650 
    -
    651 static int stbi__sse2_available(void)
    -
    652 {
    -
    653  // If we're even attempting to compile this on GCC/Clang, that means
    -
    654  // -msse2 is on, which means the compiler is allowed to use SSE2
    -
    655  // instructions at will, and so are we.
    -
    656  return 1;
    -
    657 }
    -
    658 #endif
    -
    659 #endif
    -
    660 
    -
    661 // ARM NEON
    -
    662 #if defined(STBI_NO_SIMD) && defined(STBI_NEON)
    -
    663 #undef STBI_NEON
    -
    664 #endif
    -
    665 
    -
    666 #ifdef STBI_NEON
    -
    667 #include <arm_neon.h>
    -
    668 // assume GCC or Clang on ARM targets
    -
    669 #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
    -
    670 #endif
    -
    671 
    -
    672 #ifndef STBI_SIMD_ALIGN
    -
    673 #define STBI_SIMD_ALIGN(type, name) type name
    -
    674 #endif
    -
    675 
    -
    677 //
    -
    678 // stbi__context struct and start_xxx functions
    -
    679 
    -
    680 // stbi__context structure is our basic context used by all images, so it
    -
    681 // contains all the IO context, plus some basic image information
    -
    682 typedef struct
    -
    683 {
    -
    684  stbi__uint32 img_x, img_y;
    -
    685  int img_n, img_out_n;
    -
    686 
    - -
    688  void *io_user_data;
    -
    689 
    -
    690  int read_from_callbacks;
    -
    691  int buflen;
    -
    692  stbi_uc buffer_start[128];
    -
    693 
    -
    694  stbi_uc *img_buffer, *img_buffer_end;
    -
    695  stbi_uc *img_buffer_original, *img_buffer_original_end;
    -
    696 } stbi__context;
    -
    697 
    -
    698 
    -
    699 static void stbi__refill_buffer(stbi__context *s);
    -
    700 
    -
    701 // initialize a memory-decode context
    -
    702 static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
    -
    703 {
    -
    704  s->io.read = NULL;
    -
    705  s->read_from_callbacks = 0;
    -
    706  s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;
    -
    707  s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len;
    -
    708 }
    -
    709 
    -
    710 // initialize a callback-based context
    -
    711 static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)
    -
    712 {
    -
    713  s->io = *c;
    -
    714  s->io_user_data = user;
    -
    715  s->buflen = sizeof(s->buffer_start);
    -
    716  s->read_from_callbacks = 1;
    -
    717  s->img_buffer_original = s->buffer_start;
    -
    718  stbi__refill_buffer(s);
    -
    719  s->img_buffer_original_end = s->img_buffer_end;
    -
    720 }
    -
    721 
    -
    722 #ifndef STBI_NO_STDIO
    -
    723 
    -
    724 static int stbi__stdio_read(void *user, char *data, int size)
    -
    725 {
    -
    726  return (int) fread(data,1,size,(FILE*) user);
    -
    727 }
    +
    588 #ifdef _MSC_VER
    +
    589 #define STBI_HAS_LROTL
    +
    590 #endif
    +
    591 
    +
    592 #ifdef STBI_HAS_LROTL
    +
    593 #define stbi_lrot(x, y) _lrotl(x, y)
    +
    594 #else
    +
    595 #define stbi_lrot(x, y) (((x) << (y)) | ((x) >> (32 - (y))))
    +
    596 #endif
    +
    597 
    +
    598 #if defined(STBI_MALLOC) && defined(STBI_FREE) && \
    +
    599  (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED))
    +
    600 // ok
    +
    601 #elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && \
    +
    602  !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED)
    +
    603 // ok
    +
    604 #else
    +
    605 #error \
    +
    606  "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)."
    +
    607 #endif
    +
    608 
    +
    609 #ifndef STBI_MALLOC
    +
    610 #define STBI_MALLOC(sz) malloc(sz)
    +
    611 #define STBI_REALLOC(p, newsz) realloc(p, newsz)
    +
    612 #define STBI_FREE(p) free(p)
    +
    613 #endif
    +
    614 
    +
    615 #ifndef STBI_REALLOC_SIZED
    +
    616 #define STBI_REALLOC_SIZED(p, oldsz, newsz) STBI_REALLOC(p, newsz)
    +
    617 #endif
    +
    618 
    +
    619 // x86/x64 detection
    +
    620 #if defined(__x86_64__) || defined(_M_X64)
    +
    621 #define STBI__X64_TARGET
    +
    622 #elif defined(__i386) || defined(_M_IX86)
    +
    623 #define STBI__X86_TARGET
    +
    624 #endif
    +
    625 
    +
    626 #if defined(__GNUC__) && defined(STBI__X86_TARGET) && !defined(__SSE2__) && \
    +
    627  !defined(STBI_NO_SIMD)
    +
    628 // gcc doesn't support sse2 intrinsics unless you compile with -msse2,
    +
    629 // which in turn means it gets to use SSE2 everywhere. This is unfortunate,
    +
    630 // but previous attempts to provide the SSE2 functions with runtime
    +
    631 // detection caused numerous issues. The way architecture extensions are
    +
    632 // exposed in GCC/Clang is, sadly, not really suited for one-file libs.
    +
    633 // New behavior: if compiled with -msse2, we use SSE2 without any
    +
    634 // detection; if not, we don't use it at all.
    +
    635 #define STBI_NO_SIMD
    +
    636 #endif
    +
    637 
    +
    638 #if defined(__MINGW32__) && defined(STBI__X86_TARGET) && \
    +
    639  !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)
    +
    640 // Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid
    +
    641 // STBI__X64_TARGET
    +
    642 //
    +
    643 // 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the
    +
    644 // Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.
    +
    645 // As a result, enabling SSE2 on 32-bit MinGW is dangerous when not
    +
    646 // simultaneously enabling "-mstackrealign".
    +
    647 //
    +
    648 // See https://github.com/nothings/stb/issues/81 for more information.
    +
    649 //
    +
    650 // So default to no SSE2 on 32-bit MinGW. If you've read this far and added
    +
    651 // -mstackrealign to your build settings, feel free to #define
    +
    652 // STBI_MINGW_ENABLE_SSE2.
    +
    653 #define STBI_NO_SIMD
    +
    654 #endif
    +
    655 
    +
    656 #if !defined(STBI_NO_SIMD) && \
    +
    657  (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET))
    +
    658 #define STBI_SSE2
    +
    659 #include <emmintrin.h>
    +
    660 
    +
    661 #ifdef _MSC_VER
    +
    662 
    +
    663 #if _MSC_VER >= 1400 // not VC6
    +
    664 #include <intrin.h> // __cpuid
    +
    665 static int stbi__cpuid3(void)
    +
    666 {
    +
    667  int info[4];
    +
    668  __cpuid(info, 1);
    +
    669  return info[3];
    +
    670 }
    +
    671 #else
    +
    672 static int stbi__cpuid3(void)
    +
    673 {
    +
    674  int res;
    +
    675  __asm {
    +
    676  mov eax,1
    +
    677  cpuid
    +
    678  mov res,edx
    +
    679  }
    +
    680  return res;
    +
    681 }
    +
    682 #endif
    +
    683 
    +
    684 #define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name
    +
    685 
    +
    686 static int stbi__sse2_available(void)
    +
    687 {
    +
    688  int info3 = stbi__cpuid3();
    +
    689  return ((info3 >> 26) & 1) != 0;
    +
    690 }
    +
    691 #else // assume GCC-style if not VC++
    +
    692 #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
    +
    693 
    +
    694 static int stbi__sse2_available(void)
    +
    695 {
    +
    696  // If we're even attempting to compile this on GCC/Clang, that means
    +
    697  // -msse2 is on, which means the compiler is allowed to use SSE2
    +
    698  // instructions at will, and so are we.
    +
    699  return 1;
    +
    700 }
    +
    701 #endif
    +
    702 #endif
    +
    703 
    +
    704 // ARM NEON
    +
    705 #if defined(STBI_NO_SIMD) && defined(STBI_NEON)
    +
    706 #undef STBI_NEON
    +
    707 #endif
    +
    708 
    +
    709 #ifdef STBI_NEON
    +
    710 #include <arm_neon.h>
    +
    711 // assume GCC or Clang on ARM targets
    +
    712 #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
    +
    713 #endif
    +
    714 
    +
    715 #ifndef STBI_SIMD_ALIGN
    +
    716 #define STBI_SIMD_ALIGN(type, name) type name
    +
    717 #endif
    +
    718 
    +
    720 //
    +
    721 // stbi__context struct and start_xxx functions
    +
    722 
    +
    723 // stbi__context structure is our basic context used by all images, so it
    +
    724 // contains all the IO context, plus some basic image information
    +
    725 typedef struct {
    +
    726  stbi__uint32 img_x, img_y;
    +
    727  int img_n, img_out_n;
    728 
    -
    729 static void stbi__stdio_skip(void *user, int n)
    -
    730 {
    -
    731  fseek((FILE*) user, n, SEEK_CUR);
    -
    732 }
    -
    733 
    -
    734 static int stbi__stdio_eof(void *user)
    -
    735 {
    -
    736  return feof((FILE*) user);
    -
    737 }
    -
    738 
    -
    739 static stbi_io_callbacks stbi__stdio_callbacks =
    -
    740 {
    -
    741  stbi__stdio_read,
    -
    742  stbi__stdio_skip,
    -
    743  stbi__stdio_eof,
    -
    744 };
    -
    745 
    -
    746 static void stbi__start_file(stbi__context *s, FILE *f)
    -
    747 {
    -
    748  stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f);
    + +
    730  void *io_user_data;
    +
    731 
    +
    732  int read_from_callbacks;
    +
    733  int buflen;
    +
    734  stbi_uc buffer_start[128];
    +
    735 
    +
    736  stbi_uc *img_buffer, *img_buffer_end;
    +
    737  stbi_uc *img_buffer_original, *img_buffer_original_end;
    +
    738 } stbi__context;
    +
    739 
    +
    740 static void stbi__refill_buffer(stbi__context *s);
    +
    741 
    +
    742 // initialize a memory-decode context
    +
    743 static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
    +
    744 {
    +
    745  s->io.read = NULL;
    +
    746  s->read_from_callbacks = 0;
    +
    747  s->img_buffer = s->img_buffer_original = (stbi_uc *)buffer;
    +
    748  s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *)buffer + len;
    749 }
    750 
    -
    751 //static void stop_file(stbi__context *s) { }
    -
    752 
    -
    753 #endif // !STBI_NO_STDIO
    -
    754 
    -
    755 static void stbi__rewind(stbi__context *s)
    -
    756 {
    -
    757  // conceptually rewind SHOULD rewind to the beginning of the stream,
    -
    758  // but we just rewind to the beginning of the initial buffer, because
    -
    759  // we only use it after doing 'test', which only ever looks at at most 92 bytes
    -
    760  s->img_buffer = s->img_buffer_original;
    -
    761  s->img_buffer_end = s->img_buffer_original_end;
    +
    751 // initialize a callback-based context
    +
    752 static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c,
    +
    753  void *user)
    +
    754 {
    +
    755  s->io = *c;
    +
    756  s->io_user_data = user;
    +
    757  s->buflen = sizeof(s->buffer_start);
    +
    758  s->read_from_callbacks = 1;
    +
    759  s->img_buffer_original = s->buffer_start;
    +
    760  stbi__refill_buffer(s);
    +
    761  s->img_buffer_original_end = s->img_buffer_end;
    762 }
    763 
    -
    764 enum
    -
    765 {
    -
    766  STBI_ORDER_RGB,
    -
    767  STBI_ORDER_BGR
    -
    768 };
    -
    769 
    -
    770 typedef struct
    -
    771 {
    -
    772  int bits_per_channel;
    -
    773  int num_channels;
    -
    774  int channel_order;
    -
    775 } stbi__result_info;
    -
    776 
    -
    777 #ifndef STBI_NO_JPEG
    -
    778 static int stbi__jpeg_test(stbi__context *s);
    -
    779 static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    780 static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);
    -
    781 #endif
    -
    782 
    -
    783 #ifndef STBI_NO_PNG
    -
    784 static int stbi__png_test(stbi__context *s);
    -
    785 static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    786 static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);
    -
    787 #endif
    -
    788 
    -
    789 #ifndef STBI_NO_BMP
    -
    790 static int stbi__bmp_test(stbi__context *s);
    -
    791 static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    792 static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);
    -
    793 #endif
    -
    794 
    -
    795 #ifndef STBI_NO_TGA
    -
    796 static int stbi__tga_test(stbi__context *s);
    -
    797 static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    798 static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);
    -
    799 #endif
    -
    800 
    -
    801 #ifndef STBI_NO_PSD
    -
    802 static int stbi__psd_test(stbi__context *s);
    -
    803 static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc);
    -
    804 static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);
    -
    805 #endif
    -
    806 
    -
    807 #ifndef STBI_NO_HDR
    -
    808 static int stbi__hdr_test(stbi__context *s);
    -
    809 static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    810 static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);
    -
    811 #endif
    -
    812 
    -
    813 #ifndef STBI_NO_PIC
    -
    814 static int stbi__pic_test(stbi__context *s);
    -
    815 static void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    816 static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);
    -
    817 #endif
    -
    818 
    -
    819 #ifndef STBI_NO_GIF
    -
    820 static int stbi__gif_test(stbi__context *s);
    -
    821 static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    822 static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);
    -
    823 #endif
    -
    824 
    -
    825 #ifndef STBI_NO_PNM
    -
    826 static int stbi__pnm_test(stbi__context *s);
    -
    827 static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
    -
    828 static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);
    -
    829 #endif
    -
    830 
    -
    831 // this is not threadsafe
    -
    832 static const char *stbi__g_failure_reason;
    -
    833 
    -
    834 STBIDEF const char *stbi_failure_reason(void)
    -
    835 {
    -
    836  return stbi__g_failure_reason;
    -
    837 }
    -
    838 
    -
    839 static int stbi__err(const char *str)
    -
    840 {
    -
    841  stbi__g_failure_reason = str;
    -
    842  return 0;
    -
    843 }
    -
    844 
    -
    845 static void *stbi__malloc(size_t size)
    -
    846 {
    -
    847  return STBI_MALLOC(size);
    -
    848 }
    -
    849 
    -
    850 // stb_image uses ints pervasively, including for offset calculations.
    -
    851 // therefore the largest decoded image size we can support with the
    -
    852 // current code, even on 64-bit targets, is INT_MAX. this is not a
    -
    853 // significant limitation for the intended use case.
    -
    854 //
    -
    855 // we do, however, need to make sure our size calculations don't
    -
    856 // overflow. hence a few helper functions for size calculations that
    -
    857 // multiply integers together, making sure that they're non-negative
    -
    858 // and no overflow occurs.
    -
    859 
    -
    860 // return 1 if the sum is valid, 0 on overflow.
    -
    861 // negative terms are considered invalid.
    -
    862 static int stbi__addsizes_valid(int a, int b)
    -
    863 {
    -
    864  if (b < 0) return 0;
    -
    865  // now 0 <= b <= INT_MAX, hence also
    -
    866  // 0 <= INT_MAX - b <= INTMAX.
    -
    867  // And "a + b <= INT_MAX" (which might overflow) is the
    -
    868  // same as a <= INT_MAX - b (no overflow)
    -
    869  return a <= INT_MAX - b;
    -
    870 }
    -
    871 
    -
    872 // returns 1 if the product is valid, 0 on overflow.
    -
    873 // negative factors are considered invalid.
    -
    874 static int stbi__mul2sizes_valid(int a, int b)
    -
    875 {
    -
    876  if (a < 0 || b < 0) return 0;
    -
    877  if (b == 0) return 1; // mul-by-0 is always safe
    -
    878  // portable way to check for no overflows in a*b
    -
    879  return a <= INT_MAX/b;
    -
    880 }
    -
    881 
    -
    882 // returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
    -
    883 static int stbi__mad2sizes_valid(int a, int b, int add)
    -
    884 {
    -
    885  return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add);
    -
    886 }
    -
    887 
    -
    888 // returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow
    -
    889 static int stbi__mad3sizes_valid(int a, int b, int c, int add)
    -
    890 {
    -
    891  return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
    -
    892  stbi__addsizes_valid(a*b*c, add);
    -
    893 }
    -
    894 
    -
    895 // returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow
    -
    896 static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
    -
    897 {
    -
    898  return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
    -
    899  stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add);
    -
    900 }
    -
    901 
    -
    902 // mallocs with size overflow checking
    -
    903 static void *stbi__malloc_mad2(int a, int b, int add)
    -
    904 {
    -
    905  if (!stbi__mad2sizes_valid(a, b, add)) return NULL;
    -
    906  return stbi__malloc(a*b + add);
    -
    907 }
    -
    908 
    -
    909 static void *stbi__malloc_mad3(int a, int b, int c, int add)
    -
    910 {
    -
    911  if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL;
    -
    912  return stbi__malloc(a*b*c + add);
    -
    913 }
    -
    914 
    -
    915 static void *stbi__malloc_mad4(int a, int b, int c, int d, int add)
    -
    916 {
    -
    917  if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL;
    -
    918  return stbi__malloc(a*b*c*d + add);
    -
    919 }
    -
    920 
    -
    921 // stbi__err - error
    -
    922 // stbi__errpf - error returning pointer to float
    -
    923 // stbi__errpuc - error returning pointer to unsigned char
    -
    924 
    -
    925 #ifdef STBI_NO_FAILURE_STRINGS
    -
    926  #define stbi__err(x,y) 0
    -
    927 #elif defined(STBI_FAILURE_USERMSG)
    -
    928  #define stbi__err(x,y) stbi__err(y)
    -
    929 #else
    -
    930  #define stbi__err(x,y) stbi__err(x)
    -
    931 #endif
    -
    932 
    -
    933 #define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
    -
    934 #define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
    -
    935 
    -
    936 STBIDEF void stbi_image_free(void *retval_from_stbi_load)
    -
    937 {
    -
    938  STBI_FREE(retval_from_stbi_load);
    -
    939 }
    -
    940 
    -
    941 #ifndef STBI_NO_LINEAR
    -
    942 static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
    -
    943 #endif
    -
    944 
    -
    945 #ifndef STBI_NO_HDR
    -
    946 static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
    -
    947 #endif
    -
    948 
    -
    949 static int stbi__vertically_flip_on_load = 0;
    -
    950 
    -
    951 STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
    -
    952 {
    -
    953  stbi__vertically_flip_on_load = flag_true_if_should_flip;
    -
    954 }
    -
    955 
    -
    956 static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
    -
    957 {
    -
    958  memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields
    -
    959  ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed
    -
    960  ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order
    -
    961  ri->num_channels = 0;
    -
    962 
    -
    963  #ifndef STBI_NO_JPEG
    -
    964  if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri);
    -
    965  #endif
    -
    966  #ifndef STBI_NO_PNG
    -
    967  if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri);
    -
    968  #endif
    -
    969  #ifndef STBI_NO_BMP
    -
    970  if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp, ri);
    -
    971  #endif
    -
    972  #ifndef STBI_NO_GIF
    -
    973  if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp, ri);
    -
    974  #endif
    -
    975  #ifndef STBI_NO_PSD
    -
    976  if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc);
    -
    977  #endif
    -
    978  #ifndef STBI_NO_PIC
    -
    979  if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri);
    -
    980  #endif
    -
    981  #ifndef STBI_NO_PNM
    -
    982  if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri);
    -
    983  #endif
    -
    984 
    -
    985  #ifndef STBI_NO_HDR
    -
    986  if (stbi__hdr_test(s)) {
    -
    987  float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri);
    -
    988  return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
    -
    989  }
    -
    990  #endif
    -
    991 
    -
    992  #ifndef STBI_NO_TGA
    -
    993  // test tga last because it's a crappy test!
    -
    994  if (stbi__tga_test(s))
    -
    995  return stbi__tga_load(s,x,y,comp,req_comp, ri);
    -
    996  #endif
    -
    997 
    -
    998  return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
    -
    999 }
    -
    1000 
    -
    1001 static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int channels)
    -
    1002 {
    -
    1003  int i;
    -
    1004  int img_len = w * h * channels;
    -
    1005  stbi_uc *reduced;
    -
    1006 
    -
    1007  reduced = (stbi_uc *) stbi__malloc(img_len);
    -
    1008  if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory");
    -
    1009 
    -
    1010  for (i = 0; i < img_len; ++i)
    -
    1011  reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling
    -
    1012 
    -
    1013  STBI_FREE(orig);
    -
    1014  return reduced;
    -
    1015 }
    -
    1016 
    -
    1017 static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels)
    -
    1018 {
    -
    1019  int i;
    -
    1020  int img_len = w * h * channels;
    -
    1021  stbi__uint16 *enlarged;
    +
    764 #ifndef STBI_NO_STDIO
    +
    765 
    +
    766 static int stbi__stdio_read(void *user, char *data, int size)
    +
    767 {
    +
    768  return (int)fread(data, 1, size, (FILE *)user);
    +
    769 }
    +
    770 
    +
    771 static void stbi__stdio_skip(void *user, int n)
    +
    772 {
    +
    773  fseek((FILE *)user, n, SEEK_CUR);
    +
    774 }
    +
    775 
    +
    776 static int stbi__stdio_eof(void *user)
    +
    777 {
    +
    778  return feof((FILE *)user);
    +
    779 }
    +
    780 
    +
    781 static stbi_io_callbacks stbi__stdio_callbacks = {
    +
    782  stbi__stdio_read,
    +
    783  stbi__stdio_skip,
    +
    784  stbi__stdio_eof,
    +
    785 };
    +
    786 
    +
    787 static void stbi__start_file(stbi__context *s, FILE *f)
    +
    788 {
    +
    789  stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *)f);
    +
    790 }
    +
    791 
    +
    792  // static void stop_file(stbi__context *s) { }
    +
    793 
    +
    794 #endif // !STBI_NO_STDIO
    +
    795 
    +
    796 static void stbi__rewind(stbi__context *s)
    +
    797 {
    +
    798  // conceptually rewind SHOULD rewind to the beginning of the stream,
    +
    799  // but we just rewind to the beginning of the initial buffer, because
    +
    800  // we only use it after doing 'test', which only ever looks at at most 92
    +
    801  // bytes
    +
    802  s->img_buffer = s->img_buffer_original;
    +
    803  s->img_buffer_end = s->img_buffer_original_end;
    +
    804 }
    +
    805 
    +
    806 enum { STBI_ORDER_RGB, STBI_ORDER_BGR };
    +
    807 
    +
    808 typedef struct {
    +
    809  int bits_per_channel;
    +
    810  int num_channels;
    +
    811  int channel_order;
    +
    812 } stbi__result_info;
    +
    813 
    +
    814 #ifndef STBI_NO_JPEG
    +
    815 static int stbi__jpeg_test(stbi__context *s);
    +
    816 static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp,
    +
    817  int req_comp, stbi__result_info *ri);
    +
    818 static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);
    +
    819 #endif
    +
    820 
    +
    821 #ifndef STBI_NO_PNG
    +
    822 static int stbi__png_test(stbi__context *s);
    +
    823 static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp,
    +
    824  int req_comp, stbi__result_info *ri);
    +
    825 static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);
    +
    826 #endif
    +
    827 
    +
    828 #ifndef STBI_NO_BMP
    +
    829 static int stbi__bmp_test(stbi__context *s);
    +
    830 static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp,
    +
    831  int req_comp, stbi__result_info *ri);
    +
    832 static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);
    +
    833 #endif
    +
    834 
    +
    835 #ifndef STBI_NO_TGA
    +
    836 static int stbi__tga_test(stbi__context *s);
    +
    837 static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp,
    +
    838  int req_comp, stbi__result_info *ri);
    +
    839 static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);
    +
    840 #endif
    +
    841 
    +
    842 #ifndef STBI_NO_PSD
    +
    843 static int stbi__psd_test(stbi__context *s);
    +
    844 static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp,
    +
    845  int req_comp, stbi__result_info *ri, int bpc);
    +
    846 static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);
    +
    847 #endif
    +
    848 
    +
    849 #ifndef STBI_NO_HDR
    +
    850 static int stbi__hdr_test(stbi__context *s);
    +
    851 static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp,
    +
    852  int req_comp, stbi__result_info *ri);
    +
    853 static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);
    +
    854 #endif
    +
    855 
    +
    856 #ifndef STBI_NO_PIC
    +
    857 static int stbi__pic_test(stbi__context *s);
    +
    858 static void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp,
    +
    859  int req_comp, stbi__result_info *ri);
    +
    860 static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);
    +
    861 #endif
    +
    862 
    +
    863 #ifndef STBI_NO_GIF
    +
    864 static int stbi__gif_test(stbi__context *s);
    +
    865 static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp,
    +
    866  int req_comp, stbi__result_info *ri);
    +
    867 static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);
    +
    868 #endif
    +
    869 
    +
    870 #ifndef STBI_NO_PNM
    +
    871 static int stbi__pnm_test(stbi__context *s);
    +
    872 static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp,
    +
    873  int req_comp, stbi__result_info *ri);
    +
    874 static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);
    +
    875 #endif
    +
    876 
    +
    877 // this is not threadsafe
    +
    878 static const char *stbi__g_failure_reason;
    +
    879 
    +
    880 STBIDEF const char *stbi_failure_reason(void)
    +
    881 {
    +
    882  return stbi__g_failure_reason;
    +
    883 }
    +
    884 
    +
    885 static int stbi__err(const char *str)
    +
    886 {
    +
    887  stbi__g_failure_reason = str;
    +
    888  return 0;
    +
    889 }
    +
    890 
    +
    891 static void *stbi__malloc(size_t size)
    +
    892 {
    +
    893  return STBI_MALLOC(size);
    +
    894 }
    +
    895 
    +
    896 // stb_image uses ints pervasively, including for offset calculations.
    +
    897 // therefore the largest decoded image size we can support with the
    +
    898 // current code, even on 64-bit targets, is INT_MAX. this is not a
    +
    899 // significant limitation for the intended use case.
    +
    900 //
    +
    901 // we do, however, need to make sure our size calculations don't
    +
    902 // overflow. hence a few helper functions for size calculations that
    +
    903 // multiply integers together, making sure that they're non-negative
    +
    904 // and no overflow occurs.
    +
    905 
    +
    906 // return 1 if the sum is valid, 0 on overflow.
    +
    907 // negative terms are considered invalid.
    +
    908 static int stbi__addsizes_valid(int a, int b)
    +
    909 {
    +
    910  if (b < 0)
    +
    911  return 0;
    +
    912  // now 0 <= b <= INT_MAX, hence also
    +
    913  // 0 <= INT_MAX - b <= INTMAX.
    +
    914  // And "a + b <= INT_MAX" (which might overflow) is the
    +
    915  // same as a <= INT_MAX - b (no overflow)
    +
    916  return a <= INT_MAX - b;
    +
    917 }
    +
    918 
    +
    919 // returns 1 if the product is valid, 0 on overflow.
    +
    920 // negative factors are considered invalid.
    +
    921 static int stbi__mul2sizes_valid(int a, int b)
    +
    922 {
    +
    923  if (a < 0 || b < 0)
    +
    924  return 0;
    +
    925  if (b == 0)
    +
    926  return 1; // mul-by-0 is always safe
    +
    927  // portable way to check for no overflows in a*b
    +
    928  return a <= INT_MAX / b;
    +
    929 }
    +
    930 
    +
    931 // returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
    +
    932 static int stbi__mad2sizes_valid(int a, int b, int add)
    +
    933 {
    +
    934  return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a * b, add);
    +
    935 }
    +
    936 
    +
    937 // returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow
    +
    938 static int stbi__mad3sizes_valid(int a, int b, int c, int add)
    +
    939 {
    +
    940  return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) &&
    +
    941  stbi__addsizes_valid(a * b * c, add);
    +
    942 }
    +
    943 
    +
    944 // returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't
    +
    945 // overflow
    +
    946 static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
    +
    947 {
    +
    948  return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) &&
    +
    949  stbi__mul2sizes_valid(a * b * c, d) &&
    +
    950  stbi__addsizes_valid(a * b * c * d, add);
    +
    951 }
    +
    952 
    +
    953 // mallocs with size overflow checking
    +
    954 static void *stbi__malloc_mad2(int a, int b, int add)
    +
    955 {
    +
    956  if (!stbi__mad2sizes_valid(a, b, add))
    +
    957  return NULL;
    +
    958  return stbi__malloc(a * b + add);
    +
    959 }
    +
    960 
    +
    961 static void *stbi__malloc_mad3(int a, int b, int c, int add)
    +
    962 {
    +
    963  if (!stbi__mad3sizes_valid(a, b, c, add))
    +
    964  return NULL;
    +
    965  return stbi__malloc(a * b * c + add);
    +
    966 }
    +
    967 
    +
    968 static void *stbi__malloc_mad4(int a, int b, int c, int d, int add)
    +
    969 {
    +
    970  if (!stbi__mad4sizes_valid(a, b, c, d, add))
    +
    971  return NULL;
    +
    972  return stbi__malloc(a * b * c * d + add);
    +
    973 }
    +
    974 
    +
    975  // stbi__err - error
    +
    976  // stbi__errpf - error returning pointer to float
    +
    977  // stbi__errpuc - error returning pointer to unsigned char
    +
    978 
    +
    979 #ifdef STBI_NO_FAILURE_STRINGS
    +
    980 #define stbi__err(x, y) 0
    +
    981 #elif defined(STBI_FAILURE_USERMSG)
    +
    982 #define stbi__err(x, y) stbi__err(y)
    +
    983 #else
    +
    984 #define stbi__err(x, y) stbi__err(x)
    +
    985 #endif
    +
    986 
    +
    987 #define stbi__errpf(x, y) ((float *)(size_t)(stbi__err(x, y) ? NULL : NULL))
    +
    988 #define stbi__errpuc(x, y) \
    +
    989  ((unsigned char *)(size_t)(stbi__err(x, y) ? NULL : NULL))
    +
    990 
    +
    991 STBIDEF void stbi_image_free(void *retval_from_stbi_load)
    +
    992 {
    +
    993  STBI_FREE(retval_from_stbi_load);
    +
    994 }
    +
    995 
    +
    996 #ifndef STBI_NO_LINEAR
    +
    997 static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
    +
    998 #endif
    +
    999 
    +
    1000 #ifndef STBI_NO_HDR
    +
    1001 static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
    +
    1002 #endif
    +
    1003 
    +
    1004 static int stbi__vertically_flip_on_load = 0;
    +
    1005 
    +
    1006 STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
    +
    1007 {
    +
    1008  stbi__vertically_flip_on_load = flag_true_if_should_flip;
    +
    1009 }
    +
    1010 
    +
    1011 static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp,
    +
    1012  int req_comp, stbi__result_info *ri, int bpc)
    +
    1013 {
    +
    1014  memset(ri, 0,
    +
    1015  sizeof(*ri)); // make sure it's initialized if we add new fields
    +
    1016  ri->bits_per_channel =
    +
    1017  8; // default is 8 so most paths don't have to be changed
    +
    1018  ri->channel_order = STBI_ORDER_RGB; // all current input & output are this,
    +
    1019  // but this is here so we can add BGR
    +
    1020  // order
    +
    1021  ri->num_channels = 0;
    1022 
    -
    1023  enlarged = (stbi__uint16 *) stbi__malloc(img_len*2);
    -
    1024  if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory");
    -
    1025 
    -
    1026  for (i = 0; i < img_len; ++i)
    -
    1027  enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff
    -
    1028 
    -
    1029  STBI_FREE(orig);
    -
    1030  return enlarged;
    -
    1031 }
    -
    1032 
    -
    1033 static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel)
    -
    1034 {
    -
    1035  int row;
    -
    1036  size_t bytes_per_row = (size_t)w * bytes_per_pixel;
    -
    1037  stbi_uc temp[2048];
    -
    1038  stbi_uc *bytes = (stbi_uc *)image;
    -
    1039 
    -
    1040  for (row = 0; row < (h>>1); row++) {
    -
    1041  stbi_uc *row0 = bytes + row*bytes_per_row;
    -
    1042  stbi_uc *row1 = bytes + (h - row - 1)*bytes_per_row;
    -
    1043  // swap row0 with row1
    -
    1044  size_t bytes_left = bytes_per_row;
    -
    1045  while (bytes_left) {
    -
    1046  size_t bytes_copy = (bytes_left < sizeof(temp)) ? bytes_left : sizeof(temp);
    -
    1047  memcpy(temp, row0, bytes_copy);
    -
    1048  memcpy(row0, row1, bytes_copy);
    -
    1049  memcpy(row1, temp, bytes_copy);
    -
    1050  row0 += bytes_copy;
    -
    1051  row1 += bytes_copy;
    -
    1052  bytes_left -= bytes_copy;
    -
    1053  }
    -
    1054  }
    -
    1055 }
    -
    1056 
    -
    1057 static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
    -
    1058 {
    -
    1059  stbi__result_info ri;
    -
    1060  void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);
    -
    1061 
    -
    1062  if (result == NULL)
    -
    1063  return NULL;
    -
    1064 
    -
    1065  if (ri.bits_per_channel != 8) {
    -
    1066  STBI_ASSERT(ri.bits_per_channel == 16);
    -
    1067  result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
    -
    1068  ri.bits_per_channel = 8;
    -
    1069  }
    -
    1070 
    -
    1071  // @TODO: move stbi__convert_format to here
    -
    1072 
    -
    1073  if (stbi__vertically_flip_on_load) {
    -
    1074  int channels = req_comp ? req_comp : *comp;
    -
    1075  stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc));
    -
    1076  }
    -
    1077 
    -
    1078  return (unsigned char *) result;
    -
    1079 }
    -
    1080 
    -
    1081 static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
    -
    1082 {
    -
    1083  stbi__result_info ri;
    -
    1084  void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);
    -
    1085 
    -
    1086  if (result == NULL)
    -
    1087  return NULL;
    +
    1023 #ifndef STBI_NO_JPEG
    +
    1024  if (stbi__jpeg_test(s))
    +
    1025  return stbi__jpeg_load(s, x, y, comp, req_comp, ri);
    +
    1026 #endif
    +
    1027 #ifndef STBI_NO_PNG
    +
    1028  if (stbi__png_test(s))
    +
    1029  return stbi__png_load(s, x, y, comp, req_comp, ri);
    +
    1030 #endif
    +
    1031 #ifndef STBI_NO_BMP
    +
    1032  if (stbi__bmp_test(s))
    +
    1033  return stbi__bmp_load(s, x, y, comp, req_comp, ri);
    +
    1034 #endif
    +
    1035 #ifndef STBI_NO_GIF
    +
    1036  if (stbi__gif_test(s))
    +
    1037  return stbi__gif_load(s, x, y, comp, req_comp, ri);
    +
    1038 #endif
    +
    1039 #ifndef STBI_NO_PSD
    +
    1040  if (stbi__psd_test(s))
    +
    1041  return stbi__psd_load(s, x, y, comp, req_comp, ri, bpc);
    +
    1042 #endif
    +
    1043 #ifndef STBI_NO_PIC
    +
    1044  if (stbi__pic_test(s))
    +
    1045  return stbi__pic_load(s, x, y, comp, req_comp, ri);
    +
    1046 #endif
    +
    1047 #ifndef STBI_NO_PNM
    +
    1048  if (stbi__pnm_test(s))
    +
    1049  return stbi__pnm_load(s, x, y, comp, req_comp, ri);
    +
    1050 #endif
    +
    1051 
    +
    1052 #ifndef STBI_NO_HDR
    +
    1053  if (stbi__hdr_test(s)) {
    +
    1054  float *hdr = stbi__hdr_load(s, x, y, comp, req_comp, ri);
    +
    1055  return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
    +
    1056  }
    +
    1057 #endif
    +
    1058 
    +
    1059 #ifndef STBI_NO_TGA
    +
    1060  // test tga last because it's a crappy test!
    +
    1061  if (stbi__tga_test(s))
    +
    1062  return stbi__tga_load(s, x, y, comp, req_comp, ri);
    +
    1063 #endif
    +
    1064 
    +
    1065  return stbi__errpuc("unknown image type",
    +
    1066  "Image not of any known type, or corrupt");
    +
    1067 }
    +
    1068 
    +
    1069 static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h,
    +
    1070  int channels)
    +
    1071 {
    +
    1072  int i;
    +
    1073  int img_len = w * h * channels;
    +
    1074  stbi_uc *reduced;
    +
    1075 
    +
    1076  reduced = (stbi_uc *)stbi__malloc(img_len);
    +
    1077  if (reduced == NULL)
    +
    1078  return stbi__errpuc("outofmem", "Out of memory");
    +
    1079 
    +
    1080  for (i = 0; i < img_len; ++i)
    +
    1081  reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte
    +
    1082  // is sufficient approx
    +
    1083  // of 16->8 bit scaling
    +
    1084 
    +
    1085  STBI_FREE(orig);
    +
    1086  return reduced;
    +
    1087 }
    1088 
    -
    1089  if (ri.bits_per_channel != 16) {
    -
    1090  STBI_ASSERT(ri.bits_per_channel == 8);
    -
    1091  result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
    -
    1092  ri.bits_per_channel = 16;
    -
    1093  }
    -
    1094 
    -
    1095  // @TODO: move stbi__convert_format16 to here
    -
    1096  // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision
    -
    1097 
    -
    1098  if (stbi__vertically_flip_on_load) {
    -
    1099  int channels = req_comp ? req_comp : *comp;
    -
    1100  stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16));
    -
    1101  }
    -
    1102 
    -
    1103  return (stbi__uint16 *) result;
    -
    1104 }
    -
    1105 
    -
    1106 #ifndef STBI_NO_HDR
    -
    1107 static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp)
    -
    1108 {
    -
    1109  if (stbi__vertically_flip_on_load && result != NULL) {
    -
    1110  int channels = req_comp ? req_comp : *comp;
    -
    1111  stbi__vertical_flip(result, *x, *y, channels * sizeof(float));
    -
    1112  }
    -
    1113 }
    -
    1114 #endif
    -
    1115 
    -
    1116 #ifndef STBI_NO_STDIO
    -
    1117 
    -
    1118 static FILE *stbi__fopen(char const *filename, char const *mode)
    -
    1119 {
    -
    1120  FILE *f;
    -
    1121 #if defined(_MSC_VER) && _MSC_VER >= 1400
    -
    1122  if (0 != fopen_s(&f, filename, mode))
    -
    1123  f=0;
    -
    1124 #else
    -
    1125  f = fopen(filename, mode);
    -
    1126 #endif
    -
    1127  return f;
    -
    1128 }
    -
    1129 
    -
    1130 
    -
    1131 STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
    -
    1132 {
    -
    1133  FILE *f = stbi__fopen(filename, "rb");
    -
    1134  unsigned char *result;
    -
    1135  if (!f) return stbi__errpuc("can't fopen", "Unable to open file");
    -
    1136  result = stbi_load_from_file(f,x,y,comp,req_comp);
    -
    1137  fclose(f);
    -
    1138  return result;
    -
    1139 }
    +
    1089 static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h,
    +
    1090  int channels)
    +
    1091 {
    +
    1092  int i;
    +
    1093  int img_len = w * h * channels;
    +
    1094  stbi__uint16 *enlarged;
    +
    1095 
    +
    1096  enlarged = (stbi__uint16 *)stbi__malloc(img_len * 2);
    +
    1097  if (enlarged == NULL)
    +
    1098  return (stbi__uint16 *)stbi__errpuc("outofmem", "Out of memory");
    +
    1099 
    +
    1100  for (i = 0; i < img_len; ++i)
    +
    1101  enlarged[i] = (stbi__uint16)(
    +
    1102  (orig[i] << 8) +
    +
    1103  orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff
    +
    1104 
    +
    1105  STBI_FREE(orig);
    +
    1106  return enlarged;
    +
    1107 }
    +
    1108 
    +
    1109 static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel)
    +
    1110 {
    +
    1111  int row;
    +
    1112  size_t bytes_per_row = (size_t)w * bytes_per_pixel;
    +
    1113  stbi_uc temp[2048];
    +
    1114  stbi_uc *bytes = (stbi_uc *)image;
    +
    1115 
    +
    1116  for (row = 0; row < (h >> 1); row++) {
    +
    1117  stbi_uc *row0 = bytes + row * bytes_per_row;
    +
    1118  stbi_uc *row1 = bytes + (h - row - 1) * bytes_per_row;
    +
    1119  // swap row0 with row1
    +
    1120  size_t bytes_left = bytes_per_row;
    +
    1121  while (bytes_left) {
    +
    1122  size_t bytes_copy =
    +
    1123  (bytes_left < sizeof(temp)) ? bytes_left : sizeof(temp);
    +
    1124  memcpy(temp, row0, bytes_copy);
    +
    1125  memcpy(row0, row1, bytes_copy);
    +
    1126  memcpy(row1, temp, bytes_copy);
    +
    1127  row0 += bytes_copy;
    +
    1128  row1 += bytes_copy;
    +
    1129  bytes_left -= bytes_copy;
    +
    1130  }
    +
    1131  }
    +
    1132 }
    +
    1133 
    +
    1134 static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x,
    +
    1135  int *y, int *comp,
    +
    1136  int req_comp)
    +
    1137 {
    +
    1138  stbi__result_info ri;
    +
    1139  void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);
    1140 
    -
    1141 STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
    -
    1142 {
    -
    1143  unsigned char *result;
    -
    1144  stbi__context s;
    -
    1145  stbi__start_file(&s,f);
    -
    1146  result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
    -
    1147  if (result) {
    -
    1148  // need to 'unget' all the characters in the IO buffer
    -
    1149  fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
    -
    1150  }
    -
    1151  return result;
    -
    1152 }
    -
    1153 
    -
    1154 STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp)
    -
    1155 {
    -
    1156  stbi__uint16 *result;
    -
    1157  stbi__context s;
    -
    1158  stbi__start_file(&s,f);
    -
    1159  result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp);
    -
    1160  if (result) {
    -
    1161  // need to 'unget' all the characters in the IO buffer
    -
    1162  fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
    -
    1163  }
    -
    1164  return result;
    -
    1165 }
    -
    1166 
    -
    1167 STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp)
    -
    1168 {
    -
    1169  FILE *f = stbi__fopen(filename, "rb");
    -
    1170  stbi__uint16 *result;
    -
    1171  if (!f) return (stbi_us *) stbi__errpuc("can't fopen", "Unable to open file");
    -
    1172  result = stbi_load_from_file_16(f,x,y,comp,req_comp);
    -
    1173  fclose(f);
    -
    1174  return result;
    -
    1175 }
    -
    1176 
    +
    1141  if (result == NULL)
    +
    1142  return NULL;
    +
    1143 
    +
    1144  if (ri.bits_per_channel != 8) {
    +
    1145  STBI_ASSERT(ri.bits_per_channel == 16);
    +
    1146  result = stbi__convert_16_to_8((stbi__uint16 *)result, *x, *y,
    +
    1147  req_comp == 0 ? *comp : req_comp);
    +
    1148  ri.bits_per_channel = 8;
    +
    1149  }
    +
    1150 
    +
    1151  // @TODO: move stbi__convert_format to here
    +
    1152 
    +
    1153  if (stbi__vertically_flip_on_load) {
    +
    1154  int channels = req_comp ? req_comp : *comp;
    +
    1155  stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc));
    +
    1156  }
    +
    1157 
    +
    1158  return (unsigned char *)result;
    +
    1159 }
    +
    1160 
    +
    1161 static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x,
    +
    1162  int *y, int *comp,
    +
    1163  int req_comp)
    +
    1164 {
    +
    1165  stbi__result_info ri;
    +
    1166  void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);
    +
    1167 
    +
    1168  if (result == NULL)
    +
    1169  return NULL;
    +
    1170 
    +
    1171  if (ri.bits_per_channel != 16) {
    +
    1172  STBI_ASSERT(ri.bits_per_channel == 8);
    +
    1173  result = stbi__convert_8_to_16((stbi_uc *)result, *x, *y,
    +
    1174  req_comp == 0 ? *comp : req_comp);
    +
    1175  ri.bits_per_channel = 16;
    +
    1176  }
    1177 
    -
    1178 #endif
    -
    1179 
    -
    1180 STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels)
    -
    1181 {
    -
    1182  stbi__context s;
    -
    1183  stbi__start_mem(&s,buffer,len);
    -
    1184  return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
    -
    1185 }
    +
    1178  // @TODO: move stbi__convert_format16 to here
    +
    1179  // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to
    +
    1180  // keep more precision
    +
    1181 
    +
    1182  if (stbi__vertically_flip_on_load) {
    +
    1183  int channels = req_comp ? req_comp : *comp;
    +
    1184  stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16));
    +
    1185  }
    1186 
    -
    1187 STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels)
    -
    1188 {
    -
    1189  stbi__context s;
    -
    1190  stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
    -
    1191  return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
    -
    1192 }
    -
    1193 
    -
    1194 STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
    -
    1195 {
    -
    1196  stbi__context s;
    -
    1197  stbi__start_mem(&s,buffer,len);
    -
    1198  return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
    -
    1199 }
    -
    1200 
    -
    1201 STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
    -
    1202 {
    -
    1203  stbi__context s;
    -
    1204  stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
    -
    1205  return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
    -
    1206 }
    -
    1207 
    -
    1208 #ifndef STBI_NO_LINEAR
    -
    1209 static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
    -
    1210 {
    -
    1211  unsigned char *data;
    -
    1212  #ifndef STBI_NO_HDR
    -
    1213  if (stbi__hdr_test(s)) {
    -
    1214  stbi__result_info ri;
    -
    1215  float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri);
    -
    1216  if (hdr_data)
    -
    1217  stbi__float_postprocess(hdr_data,x,y,comp,req_comp);
    -
    1218  return hdr_data;
    -
    1219  }
    -
    1220  #endif
    -
    1221  data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp);
    -
    1222  if (data)
    -
    1223  return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
    -
    1224  return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
    +
    1187  return (stbi__uint16 *)result;
    +
    1188 }
    +
    1189 
    +
    1190 #ifndef STBI_NO_HDR
    +
    1191 static void stbi__float_postprocess(float *result, int *x, int *y, int *comp,
    +
    1192  int req_comp)
    +
    1193 {
    +
    1194  if (stbi__vertically_flip_on_load && result != NULL) {
    +
    1195  int channels = req_comp ? req_comp : *comp;
    +
    1196  stbi__vertical_flip(result, *x, *y, channels * sizeof(float));
    +
    1197  }
    +
    1198 }
    +
    1199 #endif
    +
    1200 
    +
    1201 #ifndef STBI_NO_STDIO
    +
    1202 
    +
    1203 static FILE *stbi__fopen(char const *filename, char const *mode)
    +
    1204 {
    +
    1205  FILE *f;
    +
    1206 #if defined(_MSC_VER) && _MSC_VER >= 1400
    +
    1207  if (0 != fopen_s(&f, filename, mode))
    +
    1208  f = 0;
    +
    1209 #else
    +
    1210  f = fopen(filename, mode);
    +
    1211 #endif
    +
    1212  return f;
    +
    1213 }
    +
    1214 
    +
    1215 STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp,
    +
    1216  int req_comp)
    +
    1217 {
    +
    1218  FILE *f = stbi__fopen(filename, "rb");
    +
    1219  unsigned char *result;
    +
    1220  if (!f)
    +
    1221  return stbi__errpuc("can't fopen", "Unable to open file");
    +
    1222  result = stbi_load_from_file(f, x, y, comp, req_comp);
    +
    1223  fclose(f);
    +
    1224  return result;
    1225 }
    1226 
    -
    1227 STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
    -
    1228 {
    -
    1229  stbi__context s;
    -
    1230  stbi__start_mem(&s,buffer,len);
    -
    1231  return stbi__loadf_main(&s,x,y,comp,req_comp);
    -
    1232 }
    -
    1233 
    -
    1234 STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
    -
    1235 {
    -
    1236  stbi__context s;
    -
    1237  stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
    -
    1238  return stbi__loadf_main(&s,x,y,comp,req_comp);
    +
    1227 STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp,
    +
    1228  int req_comp)
    +
    1229 {
    +
    1230  unsigned char *result;
    +
    1231  stbi__context s;
    +
    1232  stbi__start_file(&s, f);
    +
    1233  result = stbi__load_and_postprocess_8bit(&s, x, y, comp, req_comp);
    +
    1234  if (result) {
    +
    1235  // need to 'unget' all the characters in the IO buffer
    +
    1236  fseek(f, -(int)(s.img_buffer_end - s.img_buffer), SEEK_CUR);
    +
    1237  }
    +
    1238  return result;
    1239 }
    1240 
    -
    1241 #ifndef STBI_NO_STDIO
    -
    1242 STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
    +
    1241 STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp,
    +
    1242  int req_comp)
    1243 {
    -
    1244  float *result;
    -
    1245  FILE *f = stbi__fopen(filename, "rb");
    -
    1246  if (!f) return stbi__errpf("can't fopen", "Unable to open file");
    -
    1247  result = stbi_loadf_from_file(f,x,y,comp,req_comp);
    -
    1248  fclose(f);
    -
    1249  return result;
    -
    1250 }
    -
    1251 
    -
    1252 STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
    -
    1253 {
    -
    1254  stbi__context s;
    -
    1255  stbi__start_file(&s,f);
    -
    1256  return stbi__loadf_main(&s,x,y,comp,req_comp);
    -
    1257 }
    -
    1258 #endif // !STBI_NO_STDIO
    -
    1259 
    -
    1260 #endif // !STBI_NO_LINEAR
    -
    1261 
    -
    1262 // these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is
    -
    1263 // defined, for API simplicity; if STBI_NO_LINEAR is defined, it always
    -
    1264 // reports false!
    -
    1265 
    -
    1266 STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
    -
    1267 {
    -
    1268  #ifndef STBI_NO_HDR
    -
    1269  stbi__context s;
    -
    1270  stbi__start_mem(&s,buffer,len);
    -
    1271  return stbi__hdr_test(&s);
    -
    1272  #else
    -
    1273  STBI_NOTUSED(buffer);
    -
    1274  STBI_NOTUSED(len);
    -
    1275  return 0;
    -
    1276  #endif
    -
    1277 }
    +
    1244  stbi__uint16 *result;
    +
    1245  stbi__context s;
    +
    1246  stbi__start_file(&s, f);
    +
    1247  result = stbi__load_and_postprocess_16bit(&s, x, y, comp, req_comp);
    +
    1248  if (result) {
    +
    1249  // need to 'unget' all the characters in the IO buffer
    +
    1250  fseek(f, -(int)(s.img_buffer_end - s.img_buffer), SEEK_CUR);
    +
    1251  }
    +
    1252  return result;
    +
    1253 }
    +
    1254 
    +
    1255 STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp,
    +
    1256  int req_comp)
    +
    1257 {
    +
    1258  FILE *f = stbi__fopen(filename, "rb");
    +
    1259  stbi__uint16 *result;
    +
    1260  if (!f)
    +
    1261  return (stbi_us *)stbi__errpuc("can't fopen", "Unable to open file");
    +
    1262  result = stbi_load_from_file_16(f, x, y, comp, req_comp);
    +
    1263  fclose(f);
    +
    1264  return result;
    +
    1265 }
    +
    1266 
    +
    1267 #endif
    +
    1268 
    +
    1269 STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len,
    +
    1270  int *x, int *y, int *channels_in_file,
    +
    1271  int desired_channels)
    +
    1272 {
    +
    1273  stbi__context s;
    +
    1274  stbi__start_mem(&s, buffer, len);
    +
    1275  return stbi__load_and_postprocess_16bit(&s, x, y, channels_in_file,
    +
    1276  desired_channels);
    +
    1277 }
    1278 
    -
    1279 #ifndef STBI_NO_STDIO
    -
    1280 STBIDEF int stbi_is_hdr (char const *filename)
    -
    1281 {
    -
    1282  FILE *f = stbi__fopen(filename, "rb");
    -
    1283  int result=0;
    -
    1284  if (f) {
    -
    1285  result = stbi_is_hdr_from_file(f);
    -
    1286  fclose(f);
    -
    1287  }
    -
    1288  return result;
    -
    1289 }
    -
    1290 
    -
    1291 STBIDEF int stbi_is_hdr_from_file(FILE *f)
    + +
    1280  void *user, int *x, int *y,
    +
    1281  int *channels_in_file,
    +
    1282  int desired_channels)
    +
    1283 {
    +
    1284  stbi__context s;
    +
    1285  stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
    +
    1286  return stbi__load_and_postprocess_16bit(&s, x, y, channels_in_file,
    +
    1287  desired_channels);
    +
    1288 }
    +
    1289 
    +
    1290 STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    1291  int *y, int *comp, int req_comp)
    1292 {
    -
    1293  #ifndef STBI_NO_HDR
    -
    1294  stbi__context s;
    -
    1295  stbi__start_file(&s,f);
    -
    1296  return stbi__hdr_test(&s);
    -
    1297  #else
    -
    1298  STBI_NOTUSED(f);
    -
    1299  return 0;
    -
    1300  #endif
    -
    1301 }
    -
    1302 #endif // !STBI_NO_STDIO
    -
    1303 
    -
    1304 STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)
    -
    1305 {
    -
    1306  #ifndef STBI_NO_HDR
    -
    1307  stbi__context s;
    -
    1308  stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
    -
    1309  return stbi__hdr_test(&s);
    -
    1310  #else
    -
    1311  STBI_NOTUSED(clbk);
    -
    1312  STBI_NOTUSED(user);
    -
    1313  return 0;
    -
    1314  #endif
    -
    1315 }
    -
    1316 
    -
    1317 #ifndef STBI_NO_LINEAR
    -
    1318 static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;
    -
    1319 
    -
    1320 STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
    -
    1321 STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
    -
    1322 #endif
    -
    1323 
    -
    1324 static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;
    -
    1325 
    -
    1326 STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
    -
    1327 STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
    -
    1328 
    -
    1329 
    -
    1331 //
    -
    1332 // Common code used by all image loaders
    -
    1333 //
    -
    1334 
    -
    1335 enum
    -
    1336 {
    -
    1337  STBI__SCAN_load=0,
    -
    1338  STBI__SCAN_type,
    -
    1339  STBI__SCAN_header
    -
    1340 };
    -
    1341 
    -
    1342 static void stbi__refill_buffer(stbi__context *s)
    -
    1343 {
    -
    1344  int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
    -
    1345  if (n == 0) {
    -
    1346  // at end of file, treat same as if from memory, but need to handle case
    -
    1347  // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
    -
    1348  s->read_from_callbacks = 0;
    -
    1349  s->img_buffer = s->buffer_start;
    -
    1350  s->img_buffer_end = s->buffer_start+1;
    -
    1351  *s->img_buffer = 0;
    -
    1352  } else {
    -
    1353  s->img_buffer = s->buffer_start;
    -
    1354  s->img_buffer_end = s->buffer_start + n;
    -
    1355  }
    +
    1293  stbi__context s;
    +
    1294  stbi__start_mem(&s, buffer, len);
    +
    1295  return stbi__load_and_postprocess_8bit(&s, x, y, comp, req_comp);
    +
    1296 }
    +
    1297 
    + +
    1299  void *user, int *x, int *y, int *comp,
    +
    1300  int req_comp)
    +
    1301 {
    +
    1302  stbi__context s;
    +
    1303  stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
    +
    1304  return stbi__load_and_postprocess_8bit(&s, x, y, comp, req_comp);
    +
    1305 }
    +
    1306 
    +
    1307 #ifndef STBI_NO_LINEAR
    +
    1308 static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp,
    +
    1309  int req_comp)
    +
    1310 {
    +
    1311  unsigned char *data;
    +
    1312 #ifndef STBI_NO_HDR
    +
    1313  if (stbi__hdr_test(s)) {
    +
    1314  stbi__result_info ri;
    +
    1315  float *hdr_data = stbi__hdr_load(s, x, y, comp, req_comp, &ri);
    +
    1316  if (hdr_data)
    +
    1317  stbi__float_postprocess(hdr_data, x, y, comp, req_comp);
    +
    1318  return hdr_data;
    +
    1319  }
    +
    1320 #endif
    +
    1321  data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp);
    +
    1322  if (data)
    +
    1323  return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
    +
    1324  return stbi__errpf("unknown image type",
    +
    1325  "Image not of any known type, or corrupt");
    +
    1326 }
    +
    1327 
    +
    1328 STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    1329  int *y, int *comp, int req_comp)
    +
    1330 {
    +
    1331  stbi__context s;
    +
    1332  stbi__start_mem(&s, buffer, len);
    +
    1333  return stbi__loadf_main(&s, x, y, comp, req_comp);
    +
    1334 }
    +
    1335 
    + +
    1337  void *user, int *x, int *y, int *comp,
    +
    1338  int req_comp)
    +
    1339 {
    +
    1340  stbi__context s;
    +
    1341  stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
    +
    1342  return stbi__loadf_main(&s, x, y, comp, req_comp);
    +
    1343 }
    +
    1344 
    +
    1345 #ifndef STBI_NO_STDIO
    +
    1346 STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp,
    +
    1347  int req_comp)
    +
    1348 {
    +
    1349  float *result;
    +
    1350  FILE *f = stbi__fopen(filename, "rb");
    +
    1351  if (!f)
    +
    1352  return stbi__errpf("can't fopen", "Unable to open file");
    +
    1353  result = stbi_loadf_from_file(f, x, y, comp, req_comp);
    +
    1354  fclose(f);
    +
    1355  return result;
    1356 }
    1357 
    -
    1358 stbi_inline static stbi_uc stbi__get8(stbi__context *s)
    -
    1359 {
    -
    1360  if (s->img_buffer < s->img_buffer_end)
    -
    1361  return *s->img_buffer++;
    -
    1362  if (s->read_from_callbacks) {
    -
    1363  stbi__refill_buffer(s);
    -
    1364  return *s->img_buffer++;
    -
    1365  }
    -
    1366  return 0;
    -
    1367 }
    -
    1368 
    -
    1369 stbi_inline static int stbi__at_eof(stbi__context *s)
    -
    1370 {
    -
    1371  if (s->io.read) {
    -
    1372  if (!(s->io.eof)(s->io_user_data)) return 0;
    -
    1373  // if feof() is true, check if buffer = end
    -
    1374  // special case: we've only got the special 0 character at the end
    -
    1375  if (s->read_from_callbacks == 0) return 1;
    -
    1376  }
    -
    1377 
    -
    1378  return s->img_buffer >= s->img_buffer_end;
    -
    1379 }
    -
    1380 
    -
    1381 static void stbi__skip(stbi__context *s, int n)
    -
    1382 {
    -
    1383  if (n < 0) {
    -
    1384  s->img_buffer = s->img_buffer_end;
    -
    1385  return;
    -
    1386  }
    -
    1387  if (s->io.read) {
    -
    1388  int blen = (int) (s->img_buffer_end - s->img_buffer);
    -
    1389  if (blen < n) {
    -
    1390  s->img_buffer = s->img_buffer_end;
    -
    1391  (s->io.skip)(s->io_user_data, n - blen);
    -
    1392  return;
    -
    1393  }
    -
    1394  }
    -
    1395  s->img_buffer += n;
    +
    1358 STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp,
    +
    1359  int req_comp)
    +
    1360 {
    +
    1361  stbi__context s;
    +
    1362  stbi__start_file(&s, f);
    +
    1363  return stbi__loadf_main(&s, x, y, comp, req_comp);
    +
    1364 }
    +
    1365 #endif // !STBI_NO_STDIO
    +
    1366 
    +
    1367 #endif // !STBI_NO_LINEAR
    +
    1368 
    +
    1369 // these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is
    +
    1370 // defined, for API simplicity; if STBI_NO_LINEAR is defined, it always
    +
    1371 // reports false!
    +
    1372 
    +
    1373 STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
    +
    1374 {
    +
    1375 #ifndef STBI_NO_HDR
    +
    1376  stbi__context s;
    +
    1377  stbi__start_mem(&s, buffer, len);
    +
    1378  return stbi__hdr_test(&s);
    +
    1379 #else
    +
    1380  STBI_NOTUSED(buffer);
    +
    1381  STBI_NOTUSED(len);
    +
    1382  return 0;
    +
    1383 #endif
    +
    1384 }
    +
    1385 
    +
    1386 #ifndef STBI_NO_STDIO
    +
    1387 STBIDEF int stbi_is_hdr(char const *filename)
    +
    1388 {
    +
    1389  FILE *f = stbi__fopen(filename, "rb");
    +
    1390  int result = 0;
    +
    1391  if (f) {
    +
    1392  result = stbi_is_hdr_from_file(f);
    +
    1393  fclose(f);
    +
    1394  }
    +
    1395  return result;
    1396 }
    1397 
    -
    1398 static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
    +
    1398 STBIDEF int stbi_is_hdr_from_file(FILE *f)
    1399 {
    -
    1400  if (s->io.read) {
    -
    1401  int blen = (int) (s->img_buffer_end - s->img_buffer);
    -
    1402  if (blen < n) {
    -
    1403  int res, count;
    -
    1404 
    -
    1405  memcpy(buffer, s->img_buffer, blen);
    -
    1406 
    -
    1407  count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
    -
    1408  res = (count == (n-blen));
    -
    1409  s->img_buffer = s->img_buffer_end;
    -
    1410  return res;
    -
    1411  }
    -
    1412  }
    -
    1413 
    -
    1414  if (s->img_buffer+n <= s->img_buffer_end) {
    -
    1415  memcpy(buffer, s->img_buffer, n);
    -
    1416  s->img_buffer += n;
    -
    1417  return 1;
    -
    1418  } else
    -
    1419  return 0;
    -
    1420 }
    -
    1421 
    -
    1422 static int stbi__get16be(stbi__context *s)
    -
    1423 {
    -
    1424  int z = stbi__get8(s);
    -
    1425  return (z << 8) + stbi__get8(s);
    -
    1426 }
    +
    1400 #ifndef STBI_NO_HDR
    +
    1401  stbi__context s;
    +
    1402  stbi__start_file(&s, f);
    +
    1403  return stbi__hdr_test(&s);
    +
    1404 #else
    +
    1405  STBI_NOTUSED(f);
    +
    1406  return 0;
    +
    1407 #endif
    +
    1408 }
    +
    1409 #endif // !STBI_NO_STDIO
    +
    1410 
    + +
    1412  void *user)
    +
    1413 {
    +
    1414 #ifndef STBI_NO_HDR
    +
    1415  stbi__context s;
    +
    1416  stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
    +
    1417  return stbi__hdr_test(&s);
    +
    1418 #else
    +
    1419  STBI_NOTUSED(clbk);
    +
    1420  STBI_NOTUSED(user);
    +
    1421  return 0;
    +
    1422 #endif
    +
    1423 }
    +
    1424 
    +
    1425 #ifndef STBI_NO_LINEAR
    +
    1426 static float stbi__l2h_gamma = 2.2f, stbi__l2h_scale = 1.0f;
    1427 
    -
    1428 static stbi__uint32 stbi__get32be(stbi__context *s)
    +
    1428 STBIDEF void stbi_ldr_to_hdr_gamma(float gamma)
    1429 {
    -
    1430  stbi__uint32 z = stbi__get16be(s);
    -
    1431  return (z << 16) + stbi__get16be(s);
    -
    1432 }
    -
    1433 
    -
    1434 #if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF)
    -
    1435 // nothing
    -
    1436 #else
    -
    1437 static int stbi__get16le(stbi__context *s)
    -
    1438 {
    -
    1439  int z = stbi__get8(s);
    -
    1440  return z + (stbi__get8(s) << 8);
    -
    1441 }
    -
    1442 #endif
    -
    1443 
    -
    1444 #ifndef STBI_NO_BMP
    -
    1445 static stbi__uint32 stbi__get32le(stbi__context *s)
    -
    1446 {
    -
    1447  stbi__uint32 z = stbi__get16le(s);
    -
    1448  return z + (stbi__get16le(s) << 16);
    -
    1449 }
    -
    1450 #endif
    -
    1451 
    -
    1452 #define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings
    -
    1453 
    -
    1454 
    -
    1456 //
    -
    1457 // generic converter from built-in img_n to req_comp
    -
    1458 // individual types do this automatically as much as possible (e.g. jpeg
    -
    1459 // does all cases internally since it needs to colorspace convert anyway,
    -
    1460 // and it never has alpha, so very few cases ). png can automatically
    -
    1461 // interleave an alpha=255 channel, but falls back to this for other cases
    -
    1462 //
    -
    1463 // assume data buffer is malloced, so malloc a new one and free that one
    -
    1464 // only failure mode is malloc failing
    -
    1465 
    -
    1466 static stbi_uc stbi__compute_y(int r, int g, int b)
    -
    1467 {
    -
    1468  return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8);
    -
    1469 }
    -
    1470 
    -
    1471 static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)
    -
    1472 {
    -
    1473  int i,j;
    -
    1474  unsigned char *good;
    -
    1475 
    -
    1476  if (req_comp == img_n) return data;
    -
    1477  STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
    -
    1478 
    -
    1479  good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0);
    -
    1480  if (good == NULL) {
    -
    1481  STBI_FREE(data);
    -
    1482  return stbi__errpuc("outofmem", "Out of memory");
    -
    1483  }
    -
    1484 
    -
    1485  for (j=0; j < (int) y; ++j) {
    -
    1486  unsigned char *src = data + j * x * img_n ;
    -
    1487  unsigned char *dest = good + j * x * req_comp;
    -
    1488 
    -
    1489  #define STBI__COMBO(a,b) ((a)*8+(b))
    -
    1490  #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
    -
    1491  // convert source image with img_n components to one with req_comp components;
    -
    1492  // avoid switch per pixel, so use switch per scanline and massive macros
    -
    1493  switch (STBI__COMBO(img_n, req_comp)) {
    -
    1494  STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break;
    -
    1495  STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
    -
    1496  STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break;
    -
    1497  STBI__CASE(2,1) { dest[0]=src[0]; } break;
    -
    1498  STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
    -
    1499  STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;
    -
    1500  STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break;
    -
    1501  STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;
    -
    1502  STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break;
    -
    1503  STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;
    -
    1504  STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break;
    -
    1505  STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;
    -
    1506  default: STBI_ASSERT(0);
    -
    1507  }
    -
    1508  #undef STBI__CASE
    -
    1509  }
    -
    1510 
    -
    1511  STBI_FREE(data);
    -
    1512  return good;
    -
    1513 }
    -
    1514 
    -
    1515 static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
    -
    1516 {
    -
    1517  return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8);
    -
    1518 }
    -
    1519 
    -
    1520 static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y)
    -
    1521 {
    -
    1522  int i,j;
    -
    1523  stbi__uint16 *good;
    -
    1524 
    -
    1525  if (req_comp == img_n) return data;
    -
    1526  STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
    -
    1527 
    -
    1528  good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2);
    -
    1529  if (good == NULL) {
    -
    1530  STBI_FREE(data);
    -
    1531  return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory");
    -
    1532  }
    -
    1533 
    -
    1534  for (j=0; j < (int) y; ++j) {
    -
    1535  stbi__uint16 *src = data + j * x * img_n ;
    -
    1536  stbi__uint16 *dest = good + j * x * req_comp;
    -
    1537 
    -
    1538  #define STBI__COMBO(a,b) ((a)*8+(b))
    -
    1539  #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
    -
    1540  // convert source image with img_n components to one with req_comp components;
    -
    1541  // avoid switch per pixel, so use switch per scanline and massive macros
    -
    1542  switch (STBI__COMBO(img_n, req_comp)) {
    -
    1543  STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break;
    -
    1544  STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
    -
    1545  STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break;
    -
    1546  STBI__CASE(2,1) { dest[0]=src[0]; } break;
    -
    1547  STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
    -
    1548  STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;
    -
    1549  STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break;
    -
    1550  STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;
    -
    1551  STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break;
    -
    1552  STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;
    -
    1553  STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break;
    -
    1554  STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;
    -
    1555  default: STBI_ASSERT(0);
    -
    1556  }
    -
    1557  #undef STBI__CASE
    -
    1558  }
    -
    1559 
    -
    1560  STBI_FREE(data);
    -
    1561  return good;
    -
    1562 }
    -
    1563 
    -
    1564 #ifndef STBI_NO_LINEAR
    -
    1565 static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
    -
    1566 {
    -
    1567  int i,k,n;
    -
    1568  float *output;
    -
    1569  if (!data) return NULL;
    -
    1570  output = (float *) stbi__malloc_mad4(x, y, comp, sizeof(float), 0);
    -
    1571  if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); }
    -
    1572  // compute number of non-alpha components
    -
    1573  if (comp & 1) n = comp; else n = comp-1;
    -
    1574  for (i=0; i < x*y; ++i) {
    -
    1575  for (k=0; k < n; ++k) {
    -
    1576  output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);
    -
    1577  }
    -
    1578  if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
    -
    1579  }
    -
    1580  STBI_FREE(data);
    -
    1581  return output;
    -
    1582 }
    -
    1583 #endif
    -
    1584 
    -
    1585 #ifndef STBI_NO_HDR
    -
    1586 #define stbi__float2int(x) ((int) (x))
    -
    1587 static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
    -
    1588 {
    -
    1589  int i,k,n;
    -
    1590  stbi_uc *output;
    -
    1591  if (!data) return NULL;
    -
    1592  output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0);
    -
    1593  if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
    -
    1594  // compute number of non-alpha components
    -
    1595  if (comp & 1) n = comp; else n = comp-1;
    -
    1596  for (i=0; i < x*y; ++i) {
    -
    1597  for (k=0; k < n; ++k) {
    -
    1598  float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
    -
    1599  if (z < 0) z = 0;
    -
    1600  if (z > 255) z = 255;
    -
    1601  output[i*comp + k] = (stbi_uc) stbi__float2int(z);
    -
    1602  }
    -
    1603  if (k < comp) {
    -
    1604  float z = data[i*comp+k] * 255 + 0.5f;
    -
    1605  if (z < 0) z = 0;
    -
    1606  if (z > 255) z = 255;
    -
    1607  output[i*comp + k] = (stbi_uc) stbi__float2int(z);
    -
    1608  }
    -
    1609  }
    -
    1610  STBI_FREE(data);
    -
    1611  return output;
    -
    1612 }
    -
    1613 #endif
    -
    1614 
    -
    1616 //
    -
    1617 // "baseline" JPEG/JFIF decoder
    -
    1618 //
    -
    1619 // simple implementation
    -
    1620 // - doesn't support delayed output of y-dimension
    -
    1621 // - simple interface (only one output format: 8-bit interleaved RGB)
    -
    1622 // - doesn't try to recover corrupt jpegs
    -
    1623 // - doesn't allow partial loading, loading multiple at once
    -
    1624 // - still fast on x86 (copying globals into locals doesn't help x86)
    -
    1625 // - allocates lots of intermediate memory (full size of all components)
    -
    1626 // - non-interleaved case requires this anyway
    -
    1627 // - allows good upsampling (see next)
    -
    1628 // high-quality
    -
    1629 // - upsampled channels are bilinearly interpolated, even across blocks
    -
    1630 // - quality integer IDCT derived from IJG's 'slow'
    -
    1631 // performance
    -
    1632 // - fast huffman; reasonable integer IDCT
    -
    1633 // - some SIMD kernels for common paths on targets with SSE2/NEON
    -
    1634 // - uses a lot of intermediate memory, could cache poorly
    -
    1635 
    -
    1636 #ifndef STBI_NO_JPEG
    -
    1637 
    -
    1638 // huffman decoding acceleration
    -
    1639 #define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
    -
    1640 
    -
    1641 typedef struct
    -
    1642 {
    -
    1643  stbi_uc fast[1 << FAST_BITS];
    -
    1644  // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
    -
    1645  stbi__uint16 code[256];
    -
    1646  stbi_uc values[256];
    -
    1647  stbi_uc size[257];
    -
    1648  unsigned int maxcode[18];
    -
    1649  int delta[17]; // old 'firstsymbol' - old 'firstcode'
    -
    1650 } stbi__huffman;
    -
    1651 
    -
    1652 typedef struct
    -
    1653 {
    -
    1654  stbi__context *s;
    -
    1655  stbi__huffman huff_dc[4];
    -
    1656  stbi__huffman huff_ac[4];
    -
    1657  stbi__uint16 dequant[4][64];
    -
    1658  stbi__int16 fast_ac[4][1 << FAST_BITS];
    -
    1659 
    -
    1660 // sizes for components, interleaved MCUs
    -
    1661  int img_h_max, img_v_max;
    -
    1662  int img_mcu_x, img_mcu_y;
    -
    1663  int img_mcu_w, img_mcu_h;
    -
    1664 
    -
    1665 // definition of jpeg image component
    -
    1666  struct
    -
    1667  {
    -
    1668  int id;
    -
    1669  int h,v;
    -
    1670  int tq;
    -
    1671  int hd,ha;
    -
    1672  int dc_pred;
    +
    1430  stbi__l2h_gamma = gamma;
    +
    1431 }
    +
    1432 STBIDEF void stbi_ldr_to_hdr_scale(float scale)
    +
    1433 {
    +
    1434  stbi__l2h_scale = scale;
    +
    1435 }
    +
    1436 #endif
    +
    1437 
    +
    1438 static float stbi__h2l_gamma_i = 1.0f / 2.2f, stbi__h2l_scale_i = 1.0f;
    +
    1439 
    +
    1440 STBIDEF void stbi_hdr_to_ldr_gamma(float gamma)
    +
    1441 {
    +
    1442  stbi__h2l_gamma_i = 1 / gamma;
    +
    1443 }
    +
    1444 STBIDEF void stbi_hdr_to_ldr_scale(float scale)
    +
    1445 {
    +
    1446  stbi__h2l_scale_i = 1 / scale;
    +
    1447 }
    +
    1448 
    +
    1450 //
    +
    1451 // Common code used by all image loaders
    +
    1452 //
    +
    1453 
    +
    1454 enum { STBI__SCAN_load = 0, STBI__SCAN_type, STBI__SCAN_header };
    +
    1455 
    +
    1456 static void stbi__refill_buffer(stbi__context *s)
    +
    1457 {
    +
    1458  int n = (s->io.read)(s->io_user_data, (char *)s->buffer_start, s->buflen);
    +
    1459  if (n == 0) {
    +
    1460  // at end of file, treat same as if from memory, but need to handle case
    +
    1461  // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
    +
    1462  s->read_from_callbacks = 0;
    +
    1463  s->img_buffer = s->buffer_start;
    +
    1464  s->img_buffer_end = s->buffer_start + 1;
    +
    1465  *s->img_buffer = 0;
    +
    1466  } else {
    +
    1467  s->img_buffer = s->buffer_start;
    +
    1468  s->img_buffer_end = s->buffer_start + n;
    +
    1469  }
    +
    1470 }
    +
    1471 
    +
    1472 stbi_inline static stbi_uc stbi__get8(stbi__context *s)
    +
    1473 {
    +
    1474  if (s->img_buffer < s->img_buffer_end)
    +
    1475  return *s->img_buffer++;
    +
    1476  if (s->read_from_callbacks) {
    +
    1477  stbi__refill_buffer(s);
    +
    1478  return *s->img_buffer++;
    +
    1479  }
    +
    1480  return 0;
    +
    1481 }
    +
    1482 
    +
    1483 stbi_inline static int stbi__at_eof(stbi__context *s)
    +
    1484 {
    +
    1485  if (s->io.read) {
    +
    1486  if (!(s->io.eof)(s->io_user_data))
    +
    1487  return 0;
    +
    1488  // if feof() is true, check if buffer = end
    +
    1489  // special case: we've only got the special 0 character at the end
    +
    1490  if (s->read_from_callbacks == 0)
    +
    1491  return 1;
    +
    1492  }
    +
    1493 
    +
    1494  return s->img_buffer >= s->img_buffer_end;
    +
    1495 }
    +
    1496 
    +
    1497 static void stbi__skip(stbi__context *s, int n)
    +
    1498 {
    +
    1499  if (n < 0) {
    +
    1500  s->img_buffer = s->img_buffer_end;
    +
    1501  return;
    +
    1502  }
    +
    1503  if (s->io.read) {
    +
    1504  int blen = (int)(s->img_buffer_end - s->img_buffer);
    +
    1505  if (blen < n) {
    +
    1506  s->img_buffer = s->img_buffer_end;
    +
    1507  (s->io.skip)(s->io_user_data, n - blen);
    +
    1508  return;
    +
    1509  }
    +
    1510  }
    +
    1511  s->img_buffer += n;
    +
    1512 }
    +
    1513 
    +
    1514 static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
    +
    1515 {
    +
    1516  if (s->io.read) {
    +
    1517  int blen = (int)(s->img_buffer_end - s->img_buffer);
    +
    1518  if (blen < n) {
    +
    1519  int res, count;
    +
    1520 
    +
    1521  memcpy(buffer, s->img_buffer, blen);
    +
    1522 
    +
    1523  count =
    +
    1524  (s->io.read)(s->io_user_data, (char *)buffer + blen, n - blen);
    +
    1525  res = (count == (n - blen));
    +
    1526  s->img_buffer = s->img_buffer_end;
    +
    1527  return res;
    +
    1528  }
    +
    1529  }
    +
    1530 
    +
    1531  if (s->img_buffer + n <= s->img_buffer_end) {
    +
    1532  memcpy(buffer, s->img_buffer, n);
    +
    1533  s->img_buffer += n;
    +
    1534  return 1;
    +
    1535  } else
    +
    1536  return 0;
    +
    1537 }
    +
    1538 
    +
    1539 static int stbi__get16be(stbi__context *s)
    +
    1540 {
    +
    1541  int z = stbi__get8(s);
    +
    1542  return (z << 8) + stbi__get8(s);
    +
    1543 }
    +
    1544 
    +
    1545 static stbi__uint32 stbi__get32be(stbi__context *s)
    +
    1546 {
    +
    1547  stbi__uint32 z = stbi__get16be(s);
    +
    1548  return (z << 16) + stbi__get16be(s);
    +
    1549 }
    +
    1550 
    +
    1551 #if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF)
    +
    1552 // nothing
    +
    1553 #else
    +
    1554 static int stbi__get16le(stbi__context *s)
    +
    1555 {
    +
    1556  int z = stbi__get8(s);
    +
    1557  return z + (stbi__get8(s) << 8);
    +
    1558 }
    +
    1559 #endif
    +
    1560 
    +
    1561 #ifndef STBI_NO_BMP
    +
    1562 static stbi__uint32 stbi__get32le(stbi__context *s)
    +
    1563 {
    +
    1564  stbi__uint32 z = stbi__get16le(s);
    +
    1565  return z + (stbi__get16le(s) << 16);
    +
    1566 }
    +
    1567 #endif
    +
    1568 
    +
    1569 #define STBI__BYTECAST(x) \
    +
    1570  ((stbi_uc)((x)&255)) // truncate int to byte without warnings
    +
    1571 
    +
    1573 //
    +
    1574 // generic converter from built-in img_n to req_comp
    +
    1575 // individual types do this automatically as much as possible (e.g. jpeg
    +
    1576 // does all cases internally since it needs to colorspace convert anyway,
    +
    1577 // and it never has alpha, so very few cases ). png can automatically
    +
    1578 // interleave an alpha=255 channel, but falls back to this for other cases
    +
    1579 //
    +
    1580 // assume data buffer is malloced, so malloc a new one and free that one
    +
    1581 // only failure mode is malloc failing
    +
    1582 
    +
    1583 static stbi_uc stbi__compute_y(int r, int g, int b)
    +
    1584 {
    +
    1585  return (stbi_uc)(((r * 77) + (g * 150) + (29 * b)) >> 8);
    +
    1586 }
    +
    1587 
    +
    1588 static unsigned char *stbi__convert_format(unsigned char *data, int img_n,
    +
    1589  int req_comp, unsigned int x,
    +
    1590  unsigned int y)
    +
    1591 {
    +
    1592  int i, j;
    +
    1593  unsigned char *good;
    +
    1594 
    +
    1595  if (req_comp == img_n)
    +
    1596  return data;
    +
    1597  STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
    +
    1598 
    +
    1599  good = (unsigned char *)stbi__malloc_mad3(req_comp, x, y, 0);
    +
    1600  if (good == NULL) {
    +
    1601  STBI_FREE(data);
    +
    1602  return stbi__errpuc("outofmem", "Out of memory");
    +
    1603  }
    +
    1604 
    +
    1605  for (j = 0; j < (int)y; ++j) {
    +
    1606  unsigned char *src = data + j * x * img_n;
    +
    1607  unsigned char *dest = good + j * x * req_comp;
    +
    1608 
    +
    1609 #define STBI__COMBO(a, b) ((a)*8 + (b))
    +
    1610 #define STBI__CASE(a, b) \
    +
    1611  case STBI__COMBO(a, b): \
    +
    1612  for (i = x - 1; i >= 0; --i, src += a, dest += b)
    +
    1613  // convert source image with img_n components to one with req_comp
    +
    1614  // components; avoid switch per pixel, so use switch per scanline and
    +
    1615  // massive macros
    +
    1616  switch (STBI__COMBO(img_n, req_comp)) {
    +
    1617  STBI__CASE(1, 2) { dest[0] = src[0], dest[1] = 255; }
    +
    1618  break;
    +
    1619  STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; }
    +
    1620  break;
    +
    1621  STBI__CASE(1, 4)
    +
    1622  {
    +
    1623  dest[0] = dest[1] = dest[2] = src[0], dest[3] = 255;
    +
    1624  }
    +
    1625  break;
    +
    1626  STBI__CASE(2, 1) { dest[0] = src[0]; }
    +
    1627  break;
    +
    1628  STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; }
    +
    1629  break;
    +
    1630  STBI__CASE(2, 4)
    +
    1631  {
    +
    1632  dest[0] = dest[1] = dest[2] = src[0], dest[3] = src[1];
    +
    1633  }
    +
    1634  break;
    +
    1635  STBI__CASE(3, 4)
    +
    1636  {
    +
    1637  dest[0] = src[0], dest[1] = src[1], dest[2] = src[2],
    +
    1638  dest[3] = 255;
    +
    1639  }
    +
    1640  break;
    +
    1641  STBI__CASE(3, 1)
    +
    1642  {
    +
    1643  dest[0] = stbi__compute_y(src[0], src[1], src[2]);
    +
    1644  }
    +
    1645  break;
    +
    1646  STBI__CASE(3, 2)
    +
    1647  {
    +
    1648  dest[0] = stbi__compute_y(src[0], src[1], src[2]),
    +
    1649  dest[1] = 255;
    +
    1650  }
    +
    1651  break;
    +
    1652  STBI__CASE(4, 1)
    +
    1653  {
    +
    1654  dest[0] = stbi__compute_y(src[0], src[1], src[2]);
    +
    1655  }
    +
    1656  break;
    +
    1657  STBI__CASE(4, 2)
    +
    1658  {
    +
    1659  dest[0] = stbi__compute_y(src[0], src[1], src[2]),
    +
    1660  dest[1] = src[3];
    +
    1661  }
    +
    1662  break;
    +
    1663  STBI__CASE(4, 3)
    +
    1664  {
    +
    1665  dest[0] = src[0], dest[1] = src[1], dest[2] = src[2];
    +
    1666  }
    +
    1667  break;
    +
    1668  default:
    +
    1669  STBI_ASSERT(0);
    +
    1670  }
    +
    1671 #undef STBI__CASE
    +
    1672  }
    1673 
    -
    1674  int x,y,w2,h2;
    -
    1675  stbi_uc *data;
    -
    1676  void *raw_data, *raw_coeff;
    -
    1677  stbi_uc *linebuf;
    -
    1678  short *coeff; // progressive only
    -
    1679  int coeff_w, coeff_h; // number of 8x8 coefficient blocks
    -
    1680  } img_comp[4];
    -
    1681 
    -
    1682  stbi__uint32 code_buffer; // jpeg entropy-coded buffer
    -
    1683  int code_bits; // number of valid bits
    -
    1684  unsigned char marker; // marker seen while filling entropy buffer
    -
    1685  int nomore; // flag if we saw a marker so must stop
    -
    1686 
    -
    1687  int progressive;
    -
    1688  int spec_start;
    -
    1689  int spec_end;
    -
    1690  int succ_high;
    -
    1691  int succ_low;
    -
    1692  int eob_run;
    -
    1693  int jfif;
    -
    1694  int app14_color_transform; // Adobe APP14 tag
    -
    1695  int rgb;
    -
    1696 
    -
    1697  int scan_n, order[4];
    -
    1698  int restart_interval, todo;
    +
    1674  STBI_FREE(data);
    +
    1675  return good;
    +
    1676 }
    +
    1677 
    +
    1678 static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
    +
    1679 {
    +
    1680  return (stbi__uint16)(((r * 77) + (g * 150) + (29 * b)) >> 8);
    +
    1681 }
    +
    1682 
    +
    1683 static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n,
    +
    1684  int req_comp, unsigned int x,
    +
    1685  unsigned int y)
    +
    1686 {
    +
    1687  int i, j;
    +
    1688  stbi__uint16 *good;
    +
    1689 
    +
    1690  if (req_comp == img_n)
    +
    1691  return data;
    +
    1692  STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
    +
    1693 
    +
    1694  good = (stbi__uint16 *)stbi__malloc(req_comp * x * y * 2);
    +
    1695  if (good == NULL) {
    +
    1696  STBI_FREE(data);
    +
    1697  return (stbi__uint16 *)stbi__errpuc("outofmem", "Out of memory");
    +
    1698  }
    1699 
    -
    1700 // kernels
    -
    1701  void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
    -
    1702  void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);
    -
    1703  stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);
    -
    1704 } stbi__jpeg;
    -
    1705 
    -
    1706 static int stbi__build_huffman(stbi__huffman *h, int *count)
    -
    1707 {
    -
    1708  int i,j,k=0,code;
    -
    1709  // build size list for each symbol (from JPEG spec)
    -
    1710  for (i=0; i < 16; ++i)
    -
    1711  for (j=0; j < count[i]; ++j)
    -
    1712  h->size[k++] = (stbi_uc) (i+1);
    -
    1713  h->size[k] = 0;
    -
    1714 
    -
    1715  // compute actual symbols (from jpeg spec)
    -
    1716  code = 0;
    -
    1717  k = 0;
    -
    1718  for(j=1; j <= 16; ++j) {
    -
    1719  // compute delta to add to code to compute symbol id
    -
    1720  h->delta[j] = k - code;
    -
    1721  if (h->size[k] == j) {
    -
    1722  while (h->size[k] == j)
    -
    1723  h->code[k++] = (stbi__uint16) (code++);
    -
    1724  if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG");
    -
    1725  }
    -
    1726  // compute largest code + 1 for this size, preshifted as needed later
    -
    1727  h->maxcode[j] = code << (16-j);
    -
    1728  code <<= 1;
    -
    1729  }
    -
    1730  h->maxcode[j] = 0xffffffff;
    -
    1731 
    -
    1732  // build non-spec acceleration table; 255 is flag for not-accelerated
    -
    1733  memset(h->fast, 255, 1 << FAST_BITS);
    -
    1734  for (i=0; i < k; ++i) {
    -
    1735  int s = h->size[i];
    -
    1736  if (s <= FAST_BITS) {
    -
    1737  int c = h->code[i] << (FAST_BITS-s);
    -
    1738  int m = 1 << (FAST_BITS-s);
    -
    1739  for (j=0; j < m; ++j) {
    -
    1740  h->fast[c+j] = (stbi_uc) i;
    -
    1741  }
    -
    1742  }
    -
    1743  }
    -
    1744  return 1;
    -
    1745 }
    -
    1746 
    -
    1747 // build a table that decodes both magnitude and value of small ACs in
    -
    1748 // one go.
    -
    1749 static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
    -
    1750 {
    -
    1751  int i;
    -
    1752  for (i=0; i < (1 << FAST_BITS); ++i) {
    -
    1753  stbi_uc fast = h->fast[i];
    -
    1754  fast_ac[i] = 0;
    -
    1755  if (fast < 255) {
    -
    1756  int rs = h->values[fast];
    -
    1757  int run = (rs >> 4) & 15;
    -
    1758  int magbits = rs & 15;
    -
    1759  int len = h->size[fast];
    -
    1760 
    -
    1761  if (magbits && len + magbits <= FAST_BITS) {
    -
    1762  // magnitude code followed by receive_extend code
    -
    1763  int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
    -
    1764  int m = 1 << (magbits - 1);
    -
    1765  if (k < m) k += (~0U << magbits) + 1;
    -
    1766  // if the result is small enough, we can fit it in fast_ac table
    -
    1767  if (k >= -128 && k <= 127)
    -
    1768  fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits));
    -
    1769  }
    -
    1770  }
    -
    1771  }
    -
    1772 }
    -
    1773 
    -
    1774 static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
    +
    1700  for (j = 0; j < (int)y; ++j) {
    +
    1701  stbi__uint16 *src = data + j * x * img_n;
    +
    1702  stbi__uint16 *dest = good + j * x * req_comp;
    +
    1703 
    +
    1704 #define STBI__COMBO(a, b) ((a)*8 + (b))
    +
    1705 #define STBI__CASE(a, b) \
    +
    1706  case STBI__COMBO(a, b): \
    +
    1707  for (i = x - 1; i >= 0; --i, src += a, dest += b)
    +
    1708  // convert source image with img_n components to one with req_comp
    +
    1709  // components; avoid switch per pixel, so use switch per scanline and
    +
    1710  // massive macros
    +
    1711  switch (STBI__COMBO(img_n, req_comp)) {
    +
    1712  STBI__CASE(1, 2) { dest[0] = src[0], dest[1] = 0xffff; }
    +
    1713  break;
    +
    1714  STBI__CASE(1, 3) { dest[0] = dest[1] = dest[2] = src[0]; }
    +
    1715  break;
    +
    1716  STBI__CASE(1, 4)
    +
    1717  {
    +
    1718  dest[0] = dest[1] = dest[2] = src[0], dest[3] = 0xffff;
    +
    1719  }
    +
    1720  break;
    +
    1721  STBI__CASE(2, 1) { dest[0] = src[0]; }
    +
    1722  break;
    +
    1723  STBI__CASE(2, 3) { dest[0] = dest[1] = dest[2] = src[0]; }
    +
    1724  break;
    +
    1725  STBI__CASE(2, 4)
    +
    1726  {
    +
    1727  dest[0] = dest[1] = dest[2] = src[0], dest[3] = src[1];
    +
    1728  }
    +
    1729  break;
    +
    1730  STBI__CASE(3, 4)
    +
    1731  {
    +
    1732  dest[0] = src[0], dest[1] = src[1], dest[2] = src[2],
    +
    1733  dest[3] = 0xffff;
    +
    1734  }
    +
    1735  break;
    +
    1736  STBI__CASE(3, 1)
    +
    1737  {
    +
    1738  dest[0] = stbi__compute_y_16(src[0], src[1], src[2]);
    +
    1739  }
    +
    1740  break;
    +
    1741  STBI__CASE(3, 2)
    +
    1742  {
    +
    1743  dest[0] = stbi__compute_y_16(src[0], src[1], src[2]),
    +
    1744  dest[1] = 0xffff;
    +
    1745  }
    +
    1746  break;
    +
    1747  STBI__CASE(4, 1)
    +
    1748  {
    +
    1749  dest[0] = stbi__compute_y_16(src[0], src[1], src[2]);
    +
    1750  }
    +
    1751  break;
    +
    1752  STBI__CASE(4, 2)
    +
    1753  {
    +
    1754  dest[0] = stbi__compute_y_16(src[0], src[1], src[2]),
    +
    1755  dest[1] = src[3];
    +
    1756  }
    +
    1757  break;
    +
    1758  STBI__CASE(4, 3)
    +
    1759  {
    +
    1760  dest[0] = src[0], dest[1] = src[1], dest[2] = src[2];
    +
    1761  }
    +
    1762  break;
    +
    1763  default:
    +
    1764  STBI_ASSERT(0);
    +
    1765  }
    +
    1766 #undef STBI__CASE
    +
    1767  }
    +
    1768 
    +
    1769  STBI_FREE(data);
    +
    1770  return good;
    +
    1771 }
    +
    1772 
    +
    1773 #ifndef STBI_NO_LINEAR
    +
    1774 static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
    1775 {
    -
    1776  do {
    -
    1777  int b = j->nomore ? 0 : stbi__get8(j->s);
    -
    1778  if (b == 0xff) {
    -
    1779  int c = stbi__get8(j->s);
    -
    1780  while (c == 0xff) c = stbi__get8(j->s); // consume fill bytes
    -
    1781  if (c != 0) {
    -
    1782  j->marker = (unsigned char) c;
    -
    1783  j->nomore = 1;
    -
    1784  return;
    -
    1785  }
    -
    1786  }
    -
    1787  j->code_buffer |= b << (24 - j->code_bits);
    -
    1788  j->code_bits += 8;
    -
    1789  } while (j->code_bits <= 24);
    -
    1790 }
    -
    1791 
    -
    1792 // (1 << n) - 1
    -
    1793 static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
    -
    1794 
    -
    1795 // decode a jpeg huffman value from the bitstream
    -
    1796 stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
    -
    1797 {
    -
    1798  unsigned int temp;
    -
    1799  int c,k;
    -
    1800 
    -
    1801  if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
    -
    1802 
    -
    1803  // look at the top FAST_BITS and determine what symbol ID it is,
    -
    1804  // if the code is <= FAST_BITS
    -
    1805  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
    -
    1806  k = h->fast[c];
    -
    1807  if (k < 255) {
    -
    1808  int s = h->size[k];
    -
    1809  if (s > j->code_bits)
    -
    1810  return -1;
    -
    1811  j->code_buffer <<= s;
    -
    1812  j->code_bits -= s;
    -
    1813  return h->values[k];
    -
    1814  }
    -
    1815 
    -
    1816  // naive test is to shift the code_buffer down so k bits are
    -
    1817  // valid, then test against maxcode. To speed this up, we've
    -
    1818  // preshifted maxcode left so that it has (16-k) 0s at the
    -
    1819  // end; in other words, regardless of the number of bits, it
    -
    1820  // wants to be compared against something shifted to have 16;
    -
    1821  // that way we don't need to shift inside the loop.
    -
    1822  temp = j->code_buffer >> 16;
    -
    1823  for (k=FAST_BITS+1 ; ; ++k)
    -
    1824  if (temp < h->maxcode[k])
    -
    1825  break;
    -
    1826  if (k == 17) {
    -
    1827  // error! code not found
    -
    1828  j->code_bits -= 16;
    -
    1829  return -1;
    -
    1830  }
    -
    1831 
    -
    1832  if (k > j->code_bits)
    -
    1833  return -1;
    -
    1834 
    -
    1835  // convert the huffman code to the symbol id
    -
    1836  c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
    -
    1837  STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
    -
    1838 
    -
    1839  // convert the id to a symbol
    -
    1840  j->code_bits -= k;
    -
    1841  j->code_buffer <<= k;
    -
    1842  return h->values[c];
    -
    1843 }
    -
    1844 
    -
    1845 // bias[n] = (-1<<n) + 1
    -
    1846 static int const stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};
    -
    1847 
    -
    1848 // combined JPEG 'receive' and JPEG 'extend', since baseline
    -
    1849 // always extends everything it receives.
    -
    1850 stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
    -
    1851 {
    -
    1852  unsigned int k;
    -
    1853  int sgn;
    -
    1854  if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
    -
    1855 
    -
    1856  sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB
    -
    1857  k = stbi_lrot(j->code_buffer, n);
    -
    1858  STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask)));
    -
    1859  j->code_buffer = k & ~stbi__bmask[n];
    -
    1860  k &= stbi__bmask[n];
    -
    1861  j->code_bits -= n;
    -
    1862  return k + (stbi__jbias[n] & ~sgn);
    -
    1863 }
    -
    1864 
    -
    1865 // get some unsigned bits
    -
    1866 stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
    -
    1867 {
    -
    1868  unsigned int k;
    -
    1869  if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
    -
    1870  k = stbi_lrot(j->code_buffer, n);
    -
    1871  j->code_buffer = k & ~stbi__bmask[n];
    -
    1872  k &= stbi__bmask[n];
    -
    1873  j->code_bits -= n;
    -
    1874  return k;
    -
    1875 }
    -
    1876 
    -
    1877 stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
    -
    1878 {
    -
    1879  unsigned int k;
    -
    1880  if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
    -
    1881  k = j->code_buffer;
    -
    1882  j->code_buffer <<= 1;
    -
    1883  --j->code_bits;
    -
    1884  return k & 0x80000000;
    -
    1885 }
    -
    1886 
    -
    1887 // given a value that's at position X in the zigzag stream,
    -
    1888 // where does it appear in the 8x8 matrix coded as row-major?
    -
    1889 static stbi_uc stbi__jpeg_dezigzag[64+15] =
    -
    1890 {
    -
    1891  0, 1, 8, 16, 9, 2, 3, 10,
    -
    1892  17, 24, 32, 25, 18, 11, 4, 5,
    -
    1893  12, 19, 26, 33, 40, 48, 41, 34,
    -
    1894  27, 20, 13, 6, 7, 14, 21, 28,
    -
    1895  35, 42, 49, 56, 57, 50, 43, 36,
    -
    1896  29, 22, 15, 23, 30, 37, 44, 51,
    -
    1897  58, 59, 52, 45, 38, 31, 39, 46,
    -
    1898  53, 60, 61, 54, 47, 55, 62, 63,
    -
    1899  // let corrupt input sample past end
    -
    1900  63, 63, 63, 63, 63, 63, 63, 63,
    -
    1901  63, 63, 63, 63, 63, 63, 63
    -
    1902 };
    -
    1903 
    -
    1904 // decode one 64-entry block--
    -
    1905 static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant)
    -
    1906 {
    -
    1907  int diff,dc,k;
    -
    1908  int t;
    -
    1909 
    -
    1910  if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
    -
    1911  t = stbi__jpeg_huff_decode(j, hdc);
    -
    1912  if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");
    -
    1913 
    -
    1914  // 0 all the ac values now so we can do it 32-bits at a time
    -
    1915  memset(data,0,64*sizeof(data[0]));
    -
    1916 
    -
    1917  diff = t ? stbi__extend_receive(j, t) : 0;
    -
    1918  dc = j->img_comp[b].dc_pred + diff;
    -
    1919  j->img_comp[b].dc_pred = dc;
    -
    1920  data[0] = (short) (dc * dequant[0]);
    -
    1921 
    -
    1922  // decode AC components, see JPEG spec
    -
    1923  k = 1;
    -
    1924  do {
    -
    1925  unsigned int zig;
    -
    1926  int c,r,s;
    -
    1927  if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
    -
    1928  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
    -
    1929  r = fac[c];
    -
    1930  if (r) { // fast-AC path
    -
    1931  k += (r >> 4) & 15; // run
    -
    1932  s = r & 15; // combined length
    -
    1933  j->code_buffer <<= s;
    -
    1934  j->code_bits -= s;
    -
    1935  // decode into unzigzag'd location
    -
    1936  zig = stbi__jpeg_dezigzag[k++];
    -
    1937  data[zig] = (short) ((r >> 8) * dequant[zig]);
    -
    1938  } else {
    -
    1939  int rs = stbi__jpeg_huff_decode(j, hac);
    -
    1940  if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
    -
    1941  s = rs & 15;
    -
    1942  r = rs >> 4;
    -
    1943  if (s == 0) {
    -
    1944  if (rs != 0xf0) break; // end block
    -
    1945  k += 16;
    -
    1946  } else {
    -
    1947  k += r;
    -
    1948  // decode into unzigzag'd location
    -
    1949  zig = stbi__jpeg_dezigzag[k++];
    -
    1950  data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
    -
    1951  }
    -
    1952  }
    -
    1953  } while (k < 64);
    -
    1954  return 1;
    -
    1955 }
    -
    1956 
    -
    1957 static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)
    -
    1958 {
    -
    1959  int diff,dc;
    -
    1960  int t;
    -
    1961  if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
    -
    1962 
    -
    1963  if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
    -
    1964 
    -
    1965  if (j->succ_high == 0) {
    -
    1966  // first scan for DC coefficient, must be first
    -
    1967  memset(data,0,64*sizeof(data[0])); // 0 all the ac values now
    -
    1968  t = stbi__jpeg_huff_decode(j, hdc);
    -
    1969  diff = t ? stbi__extend_receive(j, t) : 0;
    -
    1970 
    -
    1971  dc = j->img_comp[b].dc_pred + diff;
    -
    1972  j->img_comp[b].dc_pred = dc;
    -
    1973  data[0] = (short) (dc << j->succ_low);
    -
    1974  } else {
    -
    1975  // refinement scan for DC coefficient
    -
    1976  if (stbi__jpeg_get_bit(j))
    -
    1977  data[0] += (short) (1 << j->succ_low);
    -
    1978  }
    -
    1979  return 1;
    +
    1776  int i, k, n;
    +
    1777  float *output;
    +
    1778  if (!data)
    +
    1779  return NULL;
    +
    1780  output = (float *)stbi__malloc_mad4(x, y, comp, sizeof(float), 0);
    +
    1781  if (output == NULL) {
    +
    1782  STBI_FREE(data);
    +
    1783  return stbi__errpf("outofmem", "Out of memory");
    +
    1784  }
    +
    1785  // compute number of non-alpha components
    +
    1786  if (comp & 1)
    +
    1787  n = comp;
    +
    1788  else
    +
    1789  n = comp - 1;
    +
    1790  for (i = 0; i < x * y; ++i) {
    +
    1791  for (k = 0; k < n; ++k) {
    +
    1792  output[i * comp + k] =
    +
    1793  (float)(pow(data[i * comp + k] / 255.0f, stbi__l2h_gamma) *
    +
    1794  stbi__l2h_scale);
    +
    1795  }
    +
    1796  if (k < comp)
    +
    1797  output[i * comp + k] = data[i * comp + k] / 255.0f;
    +
    1798  }
    +
    1799  STBI_FREE(data);
    +
    1800  return output;
    +
    1801 }
    +
    1802 #endif
    +
    1803 
    +
    1804 #ifndef STBI_NO_HDR
    +
    1805 #define stbi__float2int(x) ((int)(x))
    +
    1806 static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
    +
    1807 {
    +
    1808  int i, k, n;
    +
    1809  stbi_uc *output;
    +
    1810  if (!data)
    +
    1811  return NULL;
    +
    1812  output = (stbi_uc *)stbi__malloc_mad3(x, y, comp, 0);
    +
    1813  if (output == NULL) {
    +
    1814  STBI_FREE(data);
    +
    1815  return stbi__errpuc("outofmem", "Out of memory");
    +
    1816  }
    +
    1817  // compute number of non-alpha components
    +
    1818  if (comp & 1)
    +
    1819  n = comp;
    +
    1820  else
    +
    1821  n = comp - 1;
    +
    1822  for (i = 0; i < x * y; ++i) {
    +
    1823  for (k = 0; k < n; ++k) {
    +
    1824  float z = (float)pow(data[i * comp + k] * stbi__h2l_scale_i,
    +
    1825  stbi__h2l_gamma_i) *
    +
    1826  255 +
    +
    1827  0.5f;
    +
    1828  if (z < 0)
    +
    1829  z = 0;
    +
    1830  if (z > 255)
    +
    1831  z = 255;
    +
    1832  output[i * comp + k] = (stbi_uc)stbi__float2int(z);
    +
    1833  }
    +
    1834  if (k < comp) {
    +
    1835  float z = data[i * comp + k] * 255 + 0.5f;
    +
    1836  if (z < 0)
    +
    1837  z = 0;
    +
    1838  if (z > 255)
    +
    1839  z = 255;
    +
    1840  output[i * comp + k] = (stbi_uc)stbi__float2int(z);
    +
    1841  }
    +
    1842  }
    +
    1843  STBI_FREE(data);
    +
    1844  return output;
    +
    1845 }
    +
    1846 #endif
    +
    1847 
    +
    1849  //
    +
    1850  // "baseline" JPEG/JFIF decoder
    +
    1851  //
    +
    1852  // simple implementation
    +
    1853  // - doesn't support delayed output of y-dimension
    +
    1854  // - simple interface (only one output format: 8-bit interleaved RGB)
    +
    1855  // - doesn't try to recover corrupt jpegs
    +
    1856  // - doesn't allow partial loading, loading multiple at once
    +
    1857  // - still fast on x86 (copying globals into locals doesn't help x86)
    +
    1858  // - allocates lots of intermediate memory (full size of all
    +
    1859  // components)
    +
    1860  // - non-interleaved case requires this anyway
    +
    1861  // - allows good upsampling (see next)
    +
    1862  // high-quality
    +
    1863  // - upsampled channels are bilinearly interpolated, even across blocks
    +
    1864  // - quality integer IDCT derived from IJG's 'slow'
    +
    1865  // performance
    +
    1866  // - fast huffman; reasonable integer IDCT
    +
    1867  // - some SIMD kernels for common paths on targets with SSE2/NEON
    +
    1868  // - uses a lot of intermediate memory, could cache poorly
    +
    1869 
    +
    1870 #ifndef STBI_NO_JPEG
    +
    1871 
    +
    1872 // huffman decoding acceleration
    +
    1873 #define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
    +
    1874 
    +
    1875 typedef struct {
    +
    1876  stbi_uc fast[1 << FAST_BITS];
    +
    1877  // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
    +
    1878  stbi__uint16 code[256];
    +
    1879  stbi_uc values[256];
    +
    1880  stbi_uc size[257];
    +
    1881  unsigned int maxcode[18];
    +
    1882  int delta[17]; // old 'firstsymbol' - old 'firstcode'
    +
    1883 } stbi__huffman;
    +
    1884 
    +
    1885 typedef struct {
    +
    1886  stbi__context *s;
    +
    1887  stbi__huffman huff_dc[4];
    +
    1888  stbi__huffman huff_ac[4];
    +
    1889  stbi__uint16 dequant[4][64];
    +
    1890  stbi__int16 fast_ac[4][1 << FAST_BITS];
    +
    1891 
    +
    1892  // sizes for components, interleaved MCUs
    +
    1893  int img_h_max, img_v_max;
    +
    1894  int img_mcu_x, img_mcu_y;
    +
    1895  int img_mcu_w, img_mcu_h;
    +
    1896 
    +
    1897  // definition of jpeg image component
    +
    1898  struct {
    +
    1899  int id;
    +
    1900  int h, v;
    +
    1901  int tq;
    +
    1902  int hd, ha;
    +
    1903  int dc_pred;
    +
    1904 
    +
    1905  int x, y, w2, h2;
    +
    1906  stbi_uc *data;
    +
    1907  void *raw_data, *raw_coeff;
    +
    1908  stbi_uc *linebuf;
    +
    1909  short *coeff; // progressive only
    +
    1910  int coeff_w, coeff_h; // number of 8x8 coefficient blocks
    +
    1911  } img_comp[4];
    +
    1912 
    +
    1913  stbi__uint32 code_buffer; // jpeg entropy-coded buffer
    +
    1914  int code_bits; // number of valid bits
    +
    1915  unsigned char marker; // marker seen while filling entropy buffer
    +
    1916  int nomore; // flag if we saw a marker so must stop
    +
    1917 
    +
    1918  int progressive;
    +
    1919  int spec_start;
    +
    1920  int spec_end;
    +
    1921  int succ_high;
    +
    1922  int succ_low;
    +
    1923  int eob_run;
    +
    1924  int jfif;
    +
    1925  int app14_color_transform; // Adobe APP14 tag
    +
    1926  int rgb;
    +
    1927 
    +
    1928  int scan_n, order[4];
    +
    1929  int restart_interval, todo;
    +
    1930 
    +
    1931  // kernels
    +
    1932  void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
    +
    1933  void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y,
    +
    1934  const stbi_uc *pcb, const stbi_uc *pcr,
    +
    1935  int count, int step);
    +
    1936  stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near,
    +
    1937  stbi_uc *in_far, int w, int hs);
    +
    1938 } stbi__jpeg;
    +
    1939 
    +
    1940 static int stbi__build_huffman(stbi__huffman *h, int *count)
    +
    1941 {
    +
    1942  int i, j, k = 0, code;
    +
    1943  // build size list for each symbol (from JPEG spec)
    +
    1944  for (i = 0; i < 16; ++i)
    +
    1945  for (j = 0; j < count[i]; ++j)
    +
    1946  h->size[k++] = (stbi_uc)(i + 1);
    +
    1947  h->size[k] = 0;
    +
    1948 
    +
    1949  // compute actual symbols (from jpeg spec)
    +
    1950  code = 0;
    +
    1951  k = 0;
    +
    1952  for (j = 1; j <= 16; ++j) {
    +
    1953  // compute delta to add to code to compute symbol id
    +
    1954  h->delta[j] = k - code;
    +
    1955  if (h->size[k] == j) {
    +
    1956  while (h->size[k] == j)
    +
    1957  h->code[k++] = (stbi__uint16)(code++);
    +
    1958  if (code - 1 >= (1 << j))
    +
    1959  return stbi__err("bad code lengths", "Corrupt JPEG");
    +
    1960  }
    +
    1961  // compute largest code + 1 for this size, preshifted as needed later
    +
    1962  h->maxcode[j] = code << (16 - j);
    +
    1963  code <<= 1;
    +
    1964  }
    +
    1965  h->maxcode[j] = 0xffffffff;
    +
    1966 
    +
    1967  // build non-spec acceleration table; 255 is flag for not-accelerated
    +
    1968  memset(h->fast, 255, 1 << FAST_BITS);
    +
    1969  for (i = 0; i < k; ++i) {
    +
    1970  int s = h->size[i];
    +
    1971  if (s <= FAST_BITS) {
    +
    1972  int c = h->code[i] << (FAST_BITS - s);
    +
    1973  int m = 1 << (FAST_BITS - s);
    +
    1974  for (j = 0; j < m; ++j) {
    +
    1975  h->fast[c + j] = (stbi_uc)i;
    +
    1976  }
    +
    1977  }
    +
    1978  }
    +
    1979  return 1;
    1980 }
    1981 
    -
    1982 // @OPTIMIZE: store non-zigzagged during the decode passes,
    -
    1983 // and only de-zigzag when dequantizing
    -
    1984 static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)
    +
    1982 // build a table that decodes both magnitude and value of small ACs in
    +
    1983 // one go.
    +
    1984 static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
    1985 {
    -
    1986  int k;
    -
    1987  if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
    -
    1988 
    -
    1989  if (j->succ_high == 0) {
    -
    1990  int shift = j->succ_low;
    -
    1991 
    -
    1992  if (j->eob_run) {
    -
    1993  --j->eob_run;
    -
    1994  return 1;
    -
    1995  }
    -
    1996 
    -
    1997  k = j->spec_start;
    -
    1998  do {
    -
    1999  unsigned int zig;
    -
    2000  int c,r,s;
    -
    2001  if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
    -
    2002  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
    -
    2003  r = fac[c];
    -
    2004  if (r) { // fast-AC path
    -
    2005  k += (r >> 4) & 15; // run
    -
    2006  s = r & 15; // combined length
    -
    2007  j->code_buffer <<= s;
    -
    2008  j->code_bits -= s;
    -
    2009  zig = stbi__jpeg_dezigzag[k++];
    -
    2010  data[zig] = (short) ((r >> 8) << shift);
    -
    2011  } else {
    -
    2012  int rs = stbi__jpeg_huff_decode(j, hac);
    -
    2013  if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
    -
    2014  s = rs & 15;
    -
    2015  r = rs >> 4;
    -
    2016  if (s == 0) {
    -
    2017  if (r < 15) {
    -
    2018  j->eob_run = (1 << r);
    -
    2019  if (r)
    -
    2020  j->eob_run += stbi__jpeg_get_bits(j, r);
    -
    2021  --j->eob_run;
    -
    2022  break;
    -
    2023  }
    -
    2024  k += 16;
    -
    2025  } else {
    -
    2026  k += r;
    -
    2027  zig = stbi__jpeg_dezigzag[k++];
    -
    2028  data[zig] = (short) (stbi__extend_receive(j,s) << shift);
    -
    2029  }
    -
    2030  }
    -
    2031  } while (k <= j->spec_end);
    -
    2032  } else {
    -
    2033  // refinement scan for these AC coefficients
    -
    2034 
    -
    2035  short bit = (short) (1 << j->succ_low);
    -
    2036 
    -
    2037  if (j->eob_run) {
    -
    2038  --j->eob_run;
    -
    2039  for (k = j->spec_start; k <= j->spec_end; ++k) {
    -
    2040  short *p = &data[stbi__jpeg_dezigzag[k]];
    -
    2041  if (*p != 0)
    -
    2042  if (stbi__jpeg_get_bit(j))
    -
    2043  if ((*p & bit)==0) {
    -
    2044  if (*p > 0)
    -
    2045  *p += bit;
    -
    2046  else
    -
    2047  *p -= bit;
    -
    2048  }
    -
    2049  }
    -
    2050  } else {
    -
    2051  k = j->spec_start;
    -
    2052  do {
    -
    2053  int r,s;
    -
    2054  int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
    -
    2055  if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
    -
    2056  s = rs & 15;
    -
    2057  r = rs >> 4;
    -
    2058  if (s == 0) {
    -
    2059  if (r < 15) {
    -
    2060  j->eob_run = (1 << r) - 1;
    -
    2061  if (r)
    -
    2062  j->eob_run += stbi__jpeg_get_bits(j, r);
    -
    2063  r = 64; // force end of block
    -
    2064  } else {
    -
    2065  // r=15 s=0 should write 16 0s, so we just do
    -
    2066  // a run of 15 0s and then write s (which is 0),
    -
    2067  // so we don't have to do anything special here
    -
    2068  }
    -
    2069  } else {
    -
    2070  if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
    -
    2071  // sign bit
    -
    2072  if (stbi__jpeg_get_bit(j))
    -
    2073  s = bit;
    -
    2074  else
    -
    2075  s = -bit;
    -
    2076  }
    -
    2077 
    -
    2078  // advance by r
    -
    2079  while (k <= j->spec_end) {
    -
    2080  short *p = &data[stbi__jpeg_dezigzag[k++]];
    -
    2081  if (*p != 0) {
    -
    2082  if (stbi__jpeg_get_bit(j))
    -
    2083  if ((*p & bit)==0) {
    -
    2084  if (*p > 0)
    -
    2085  *p += bit;
    -
    2086  else
    -
    2087  *p -= bit;
    -
    2088  }
    -
    2089  } else {
    -
    2090  if (r == 0) {
    -
    2091  *p = (short) s;
    -
    2092  break;
    -
    2093  }
    -
    2094  --r;
    -
    2095  }
    -
    2096  }
    -
    2097  } while (k <= j->spec_end);
    -
    2098  }
    -
    2099  }
    -
    2100  return 1;
    -
    2101 }
    -
    2102 
    -
    2103 // take a -128..127 value and stbi__clamp it and convert to 0..255
    -
    2104 stbi_inline static stbi_uc stbi__clamp(int x)
    -
    2105 {
    -
    2106  // trick to use a single test to catch both cases
    -
    2107  if ((unsigned int) x > 255) {
    -
    2108  if (x < 0) return 0;
    -
    2109  if (x > 255) return 255;
    -
    2110  }
    -
    2111  return (stbi_uc) x;
    -
    2112 }
    -
    2113 
    -
    2114 #define stbi__f2f(x) ((int) (((x) * 4096 + 0.5)))
    -
    2115 #define stbi__fsh(x) ((x) << 12)
    -
    2116 
    -
    2117 // derived from jidctint -- DCT_ISLOW
    -
    2118 #define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
    -
    2119  int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
    -
    2120  p2 = s2; \
    -
    2121  p3 = s6; \
    -
    2122  p1 = (p2+p3) * stbi__f2f(0.5411961f); \
    -
    2123  t2 = p1 + p3*stbi__f2f(-1.847759065f); \
    -
    2124  t3 = p1 + p2*stbi__f2f( 0.765366865f); \
    -
    2125  p2 = s0; \
    -
    2126  p3 = s4; \
    -
    2127  t0 = stbi__fsh(p2+p3); \
    -
    2128  t1 = stbi__fsh(p2-p3); \
    -
    2129  x0 = t0+t3; \
    -
    2130  x3 = t0-t3; \
    -
    2131  x1 = t1+t2; \
    -
    2132  x2 = t1-t2; \
    -
    2133  t0 = s7; \
    -
    2134  t1 = s5; \
    -
    2135  t2 = s3; \
    -
    2136  t3 = s1; \
    -
    2137  p3 = t0+t2; \
    -
    2138  p4 = t1+t3; \
    -
    2139  p1 = t0+t3; \
    -
    2140  p2 = t1+t2; \
    -
    2141  p5 = (p3+p4)*stbi__f2f( 1.175875602f); \
    -
    2142  t0 = t0*stbi__f2f( 0.298631336f); \
    -
    2143  t1 = t1*stbi__f2f( 2.053119869f); \
    -
    2144  t2 = t2*stbi__f2f( 3.072711026f); \
    -
    2145  t3 = t3*stbi__f2f( 1.501321110f); \
    -
    2146  p1 = p5 + p1*stbi__f2f(-0.899976223f); \
    -
    2147  p2 = p5 + p2*stbi__f2f(-2.562915447f); \
    -
    2148  p3 = p3*stbi__f2f(-1.961570560f); \
    -
    2149  p4 = p4*stbi__f2f(-0.390180644f); \
    -
    2150  t3 += p1+p4; \
    -
    2151  t2 += p2+p3; \
    -
    2152  t1 += p2+p4; \
    -
    2153  t0 += p1+p3;
    -
    2154 
    -
    2155 static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
    -
    2156 {
    -
    2157  int i,val[64],*v=val;
    -
    2158  stbi_uc *o;
    -
    2159  short *d = data;
    +
    1986  int i;
    +
    1987  for (i = 0; i < (1 << FAST_BITS); ++i) {
    +
    1988  stbi_uc fast = h->fast[i];
    +
    1989  fast_ac[i] = 0;
    +
    1990  if (fast < 255) {
    +
    1991  int rs = h->values[fast];
    +
    1992  int run = (rs >> 4) & 15;
    +
    1993  int magbits = rs & 15;
    +
    1994  int len = h->size[fast];
    +
    1995 
    +
    1996  if (magbits && len + magbits <= FAST_BITS) {
    +
    1997  // magnitude code followed by receive_extend code
    +
    1998  int k = ((i << len) & ((1 << FAST_BITS) - 1)) >>
    +
    1999  (FAST_BITS - magbits);
    +
    2000  int m = 1 << (magbits - 1);
    +
    2001  if (k < m)
    +
    2002  k += (~0U << magbits) + 1;
    +
    2003  // if the result is small enough, we can fit it in fast_ac table
    +
    2004  if (k >= -128 && k <= 127)
    +
    2005  fast_ac[i] =
    +
    2006  (stbi__int16)((k << 8) + (run << 4) + (len + magbits));
    +
    2007  }
    +
    2008  }
    +
    2009  }
    +
    2010 }
    +
    2011 
    +
    2012 static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
    +
    2013 {
    +
    2014  do {
    +
    2015  int b = j->nomore ? 0 : stbi__get8(j->s);
    +
    2016  if (b == 0xff) {
    +
    2017  int c = stbi__get8(j->s);
    +
    2018  while (c == 0xff)
    +
    2019  c = stbi__get8(j->s); // consume fill bytes
    +
    2020  if (c != 0) {
    +
    2021  j->marker = (unsigned char)c;
    +
    2022  j->nomore = 1;
    +
    2023  return;
    +
    2024  }
    +
    2025  }
    +
    2026  j->code_buffer |= b << (24 - j->code_bits);
    +
    2027  j->code_bits += 8;
    +
    2028  } while (j->code_bits <= 24);
    +
    2029 }
    +
    2030 
    +
    2031 // (1 << n) - 1
    +
    2032 static stbi__uint32 stbi__bmask[17] = {0, 1, 3, 7, 15, 31,
    +
    2033  63, 127, 255, 511, 1023, 2047,
    +
    2034  4095, 8191, 16383, 32767, 65535};
    +
    2035 
    +
    2036 // decode a jpeg huffman value from the bitstream
    +
    2037 stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
    +
    2038 {
    +
    2039  unsigned int temp;
    +
    2040  int c, k;
    +
    2041 
    +
    2042  if (j->code_bits < 16)
    +
    2043  stbi__grow_buffer_unsafe(j);
    +
    2044 
    +
    2045  // look at the top FAST_BITS and determine what symbol ID it is,
    +
    2046  // if the code is <= FAST_BITS
    +
    2047  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS) - 1);
    +
    2048  k = h->fast[c];
    +
    2049  if (k < 255) {
    +
    2050  int s = h->size[k];
    +
    2051  if (s > j->code_bits)
    +
    2052  return -1;
    +
    2053  j->code_buffer <<= s;
    +
    2054  j->code_bits -= s;
    +
    2055  return h->values[k];
    +
    2056  }
    +
    2057 
    +
    2058  // naive test is to shift the code_buffer down so k bits are
    +
    2059  // valid, then test against maxcode. To speed this up, we've
    +
    2060  // preshifted maxcode left so that it has (16-k) 0s at the
    +
    2061  // end; in other words, regardless of the number of bits, it
    +
    2062  // wants to be compared against something shifted to have 16;
    +
    2063  // that way we don't need to shift inside the loop.
    +
    2064  temp = j->code_buffer >> 16;
    +
    2065  for (k = FAST_BITS + 1;; ++k)
    +
    2066  if (temp < h->maxcode[k])
    +
    2067  break;
    +
    2068  if (k == 17) {
    +
    2069  // error! code not found
    +
    2070  j->code_bits -= 16;
    +
    2071  return -1;
    +
    2072  }
    +
    2073 
    +
    2074  if (k > j->code_bits)
    +
    2075  return -1;
    +
    2076 
    +
    2077  // convert the huffman code to the symbol id
    +
    2078  c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
    +
    2079  STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) &
    +
    2080  stbi__bmask[h->size[c]]) == h->code[c]);
    +
    2081 
    +
    2082  // convert the id to a symbol
    +
    2083  j->code_bits -= k;
    +
    2084  j->code_buffer <<= k;
    +
    2085  return h->values[c];
    +
    2086 }
    +
    2087 
    +
    2088 // bias[n] = (-1<<n) + 1
    +
    2089 static int const stbi__jbias[16] = {0, -1, -3, -7, -15, -31,
    +
    2090  -63, -127, -255, -511, -1023, -2047,
    +
    2091  -4095, -8191, -16383, -32767};
    +
    2092 
    +
    2093 // combined JPEG 'receive' and JPEG 'extend', since baseline
    +
    2094 // always extends everything it receives.
    +
    2095 stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
    +
    2096 {
    +
    2097  unsigned int k;
    +
    2098  int sgn;
    +
    2099  if (j->code_bits < n)
    +
    2100  stbi__grow_buffer_unsafe(j);
    +
    2101 
    +
    2102  sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB
    +
    2103  k = stbi_lrot(j->code_buffer, n);
    +
    2104  STBI_ASSERT(n >= 0 &&
    +
    2105  n < (int)(sizeof(stbi__bmask) / sizeof(*stbi__bmask)));
    +
    2106  j->code_buffer = k & ~stbi__bmask[n];
    +
    2107  k &= stbi__bmask[n];
    +
    2108  j->code_bits -= n;
    +
    2109  return k + (stbi__jbias[n] & ~sgn);
    +
    2110 }
    +
    2111 
    +
    2112 // get some unsigned bits
    +
    2113 stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
    +
    2114 {
    +
    2115  unsigned int k;
    +
    2116  if (j->code_bits < n)
    +
    2117  stbi__grow_buffer_unsafe(j);
    +
    2118  k = stbi_lrot(j->code_buffer, n);
    +
    2119  j->code_buffer = k & ~stbi__bmask[n];
    +
    2120  k &= stbi__bmask[n];
    +
    2121  j->code_bits -= n;
    +
    2122  return k;
    +
    2123 }
    +
    2124 
    +
    2125 stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
    +
    2126 {
    +
    2127  unsigned int k;
    +
    2128  if (j->code_bits < 1)
    +
    2129  stbi__grow_buffer_unsafe(j);
    +
    2130  k = j->code_buffer;
    +
    2131  j->code_buffer <<= 1;
    +
    2132  --j->code_bits;
    +
    2133  return k & 0x80000000;
    +
    2134 }
    +
    2135 
    +
    2136 // given a value that's at position X in the zigzag stream,
    +
    2137 // where does it appear in the 8x8 matrix coded as row-major?
    +
    2138 static stbi_uc stbi__jpeg_dezigzag[64 + 15] = {
    +
    2139  0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40,
    +
    2140  48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36,
    +
    2141  29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61,
    +
    2142  54, 47, 55, 62, 63,
    +
    2143  // let corrupt input sample past end
    +
    2144  63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63};
    +
    2145 
    +
    2146 // decode one 64-entry block--
    +
    2147 static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64],
    +
    2148  stbi__huffman *hdc, stbi__huffman *hac,
    +
    2149  stbi__int16 *fac, int b,
    +
    2150  stbi__uint16 *dequant)
    +
    2151 {
    +
    2152  int diff, dc, k;
    +
    2153  int t;
    +
    2154 
    +
    2155  if (j->code_bits < 16)
    +
    2156  stbi__grow_buffer_unsafe(j);
    +
    2157  t = stbi__jpeg_huff_decode(j, hdc);
    +
    2158  if (t < 0)
    +
    2159  return stbi__err("bad huffman code", "Corrupt JPEG");
    2160 
    -
    2161  // columns
    -
    2162  for (i=0; i < 8; ++i,++d, ++v) {
    -
    2163  // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
    -
    2164  if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
    -
    2165  && d[40]==0 && d[48]==0 && d[56]==0) {
    -
    2166  // no shortcut 0 seconds
    -
    2167  // (1|2|3|4|5|6|7)==0 0 seconds
    -
    2168  // all separate -0.047 seconds
    -
    2169  // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
    -
    2170  int dcterm = d[0] << 2;
    -
    2171  v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
    -
    2172  } else {
    -
    2173  STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])
    -
    2174  // constants scaled things up by 1<<12; let's bring them back
    -
    2175  // down, but keep 2 extra bits of precision
    -
    2176  x0 += 512; x1 += 512; x2 += 512; x3 += 512;
    -
    2177  v[ 0] = (x0+t3) >> 10;
    -
    2178  v[56] = (x0-t3) >> 10;
    -
    2179  v[ 8] = (x1+t2) >> 10;
    -
    2180  v[48] = (x1-t2) >> 10;
    -
    2181  v[16] = (x2+t1) >> 10;
    -
    2182  v[40] = (x2-t1) >> 10;
    -
    2183  v[24] = (x3+t0) >> 10;
    -
    2184  v[32] = (x3-t0) >> 10;
    -
    2185  }
    -
    2186  }
    -
    2187 
    -
    2188  for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
    -
    2189  // no fast case since the first 1D IDCT spread components out
    -
    2190  STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])
    -
    2191  // constants scaled things up by 1<<12, plus we had 1<<2 from first
    -
    2192  // loop, plus horizontal and vertical each scale by sqrt(8) so together
    -
    2193  // we've got an extra 1<<3, so 1<<17 total we need to remove.
    -
    2194  // so we want to round that, which means adding 0.5 * 1<<17,
    -
    2195  // aka 65536. Also, we'll end up with -128 to 127 that we want
    -
    2196  // to encode as 0..255 by adding 128, so we'll add that before the shift
    -
    2197  x0 += 65536 + (128<<17);
    -
    2198  x1 += 65536 + (128<<17);
    -
    2199  x2 += 65536 + (128<<17);
    -
    2200  x3 += 65536 + (128<<17);
    -
    2201  // tried computing the shifts into temps, or'ing the temps to see
    -
    2202  // if any were out of range, but that was slower
    -
    2203  o[0] = stbi__clamp((x0+t3) >> 17);
    -
    2204  o[7] = stbi__clamp((x0-t3) >> 17);
    -
    2205  o[1] = stbi__clamp((x1+t2) >> 17);
    -
    2206  o[6] = stbi__clamp((x1-t2) >> 17);
    -
    2207  o[2] = stbi__clamp((x2+t1) >> 17);
    -
    2208  o[5] = stbi__clamp((x2-t1) >> 17);
    -
    2209  o[3] = stbi__clamp((x3+t0) >> 17);
    -
    2210  o[4] = stbi__clamp((x3-t0) >> 17);
    -
    2211  }
    -
    2212 }
    -
    2213 
    -
    2214 #ifdef STBI_SSE2
    -
    2215 // sse2 integer IDCT. not the fastest possible implementation but it
    -
    2216 // produces bit-identical results to the generic C version so it's
    -
    2217 // fully "transparent".
    -
    2218 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
    -
    2219 {
    -
    2220  // This is constructed to match our regular (generic) integer IDCT exactly.
    -
    2221  __m128i row0, row1, row2, row3, row4, row5, row6, row7;
    -
    2222  __m128i tmp;
    +
    2161  // 0 all the ac values now so we can do it 32-bits at a time
    +
    2162  memset(data, 0, 64 * sizeof(data[0]));
    +
    2163 
    +
    2164  diff = t ? stbi__extend_receive(j, t) : 0;
    +
    2165  dc = j->img_comp[b].dc_pred + diff;
    +
    2166  j->img_comp[b].dc_pred = dc;
    +
    2167  data[0] = (short)(dc * dequant[0]);
    +
    2168 
    +
    2169  // decode AC components, see JPEG spec
    +
    2170  k = 1;
    +
    2171  do {
    +
    2172  unsigned int zig;
    +
    2173  int c, r, s;
    +
    2174  if (j->code_bits < 16)
    +
    2175  stbi__grow_buffer_unsafe(j);
    +
    2176  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS) - 1);
    +
    2177  r = fac[c];
    +
    2178  if (r) { // fast-AC path
    +
    2179  k += (r >> 4) & 15; // run
    +
    2180  s = r & 15; // combined length
    +
    2181  j->code_buffer <<= s;
    +
    2182  j->code_bits -= s;
    +
    2183  // decode into unzigzag'd location
    +
    2184  zig = stbi__jpeg_dezigzag[k++];
    +
    2185  data[zig] = (short)((r >> 8) * dequant[zig]);
    +
    2186  } else {
    +
    2187  int rs = stbi__jpeg_huff_decode(j, hac);
    +
    2188  if (rs < 0)
    +
    2189  return stbi__err("bad huffman code", "Corrupt JPEG");
    +
    2190  s = rs & 15;
    +
    2191  r = rs >> 4;
    +
    2192  if (s == 0) {
    +
    2193  if (rs != 0xf0)
    +
    2194  break; // end block
    +
    2195  k += 16;
    +
    2196  } else {
    +
    2197  k += r;
    +
    2198  // decode into unzigzag'd location
    +
    2199  zig = stbi__jpeg_dezigzag[k++];
    +
    2200  data[zig] = (short)(stbi__extend_receive(j, s) * dequant[zig]);
    +
    2201  }
    +
    2202  }
    +
    2203  } while (k < 64);
    +
    2204  return 1;
    +
    2205 }
    +
    2206 
    +
    2207 static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64],
    +
    2208  stbi__huffman *hdc, int b)
    +
    2209 {
    +
    2210  int diff, dc;
    +
    2211  int t;
    +
    2212  if (j->spec_end != 0)
    +
    2213  return stbi__err("can't merge dc and ac", "Corrupt JPEG");
    +
    2214 
    +
    2215  if (j->code_bits < 16)
    +
    2216  stbi__grow_buffer_unsafe(j);
    +
    2217 
    +
    2218  if (j->succ_high == 0) {
    +
    2219  // first scan for DC coefficient, must be first
    +
    2220  memset(data, 0, 64 * sizeof(data[0])); // 0 all the ac values now
    +
    2221  t = stbi__jpeg_huff_decode(j, hdc);
    +
    2222  diff = t ? stbi__extend_receive(j, t) : 0;
    2223 
    -
    2224  // dot product constant: even elems=x, odd elems=y
    -
    2225  #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
    -
    2226 
    -
    2227  // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
    -
    2228  // out(1) = c1[even]*x + c1[odd]*y
    -
    2229  #define dct_rot(out0,out1, x,y,c0,c1) \
    -
    2230  __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
    -
    2231  __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
    -
    2232  __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
    -
    2233  __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
    -
    2234  __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
    -
    2235  __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
    -
    2236 
    -
    2237  // out = in << 12 (in 16-bit, out 32-bit)
    -
    2238  #define dct_widen(out, in) \
    -
    2239  __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
    -
    2240  __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
    -
    2241 
    -
    2242  // wide add
    -
    2243  #define dct_wadd(out, a, b) \
    -
    2244  __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
    -
    2245  __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
    -
    2246 
    -
    2247  // wide sub
    -
    2248  #define dct_wsub(out, a, b) \
    -
    2249  __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
    -
    2250  __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
    -
    2251 
    -
    2252  // butterfly a/b, add bias, then shift by "s" and pack
    -
    2253  #define dct_bfly32o(out0, out1, a,b,bias,s) \
    -
    2254  { \
    -
    2255  __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
    -
    2256  __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
    -
    2257  dct_wadd(sum, abiased, b); \
    -
    2258  dct_wsub(dif, abiased, b); \
    -
    2259  out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
    -
    2260  out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
    -
    2261  }
    -
    2262 
    -
    2263  // 8-bit interleave step (for transposes)
    -
    2264  #define dct_interleave8(a, b) \
    -
    2265  tmp = a; \
    -
    2266  a = _mm_unpacklo_epi8(a, b); \
    -
    2267  b = _mm_unpackhi_epi8(tmp, b)
    -
    2268 
    -
    2269  // 16-bit interleave step (for transposes)
    -
    2270  #define dct_interleave16(a, b) \
    -
    2271  tmp = a; \
    -
    2272  a = _mm_unpacklo_epi16(a, b); \
    -
    2273  b = _mm_unpackhi_epi16(tmp, b)
    -
    2274 
    -
    2275  #define dct_pass(bias,shift) \
    -
    2276  { \
    -
    2277  /* even part */ \
    -
    2278  dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
    -
    2279  __m128i sum04 = _mm_add_epi16(row0, row4); \
    -
    2280  __m128i dif04 = _mm_sub_epi16(row0, row4); \
    -
    2281  dct_widen(t0e, sum04); \
    -
    2282  dct_widen(t1e, dif04); \
    -
    2283  dct_wadd(x0, t0e, t3e); \
    -
    2284  dct_wsub(x3, t0e, t3e); \
    -
    2285  dct_wadd(x1, t1e, t2e); \
    -
    2286  dct_wsub(x2, t1e, t2e); \
    -
    2287  /* odd part */ \
    -
    2288  dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
    -
    2289  dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
    -
    2290  __m128i sum17 = _mm_add_epi16(row1, row7); \
    -
    2291  __m128i sum35 = _mm_add_epi16(row3, row5); \
    -
    2292  dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
    -
    2293  dct_wadd(x4, y0o, y4o); \
    -
    2294  dct_wadd(x5, y1o, y5o); \
    -
    2295  dct_wadd(x6, y2o, y5o); \
    -
    2296  dct_wadd(x7, y3o, y4o); \
    -
    2297  dct_bfly32o(row0,row7, x0,x7,bias,shift); \
    -
    2298  dct_bfly32o(row1,row6, x1,x6,bias,shift); \
    -
    2299  dct_bfly32o(row2,row5, x2,x5,bias,shift); \
    -
    2300  dct_bfly32o(row3,row4, x3,x4,bias,shift); \
    -
    2301  }
    -
    2302 
    -
    2303  __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
    -
    2304  __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));
    -
    2305  __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));
    -
    2306  __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
    -
    2307  __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));
    -
    2308  __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));
    -
    2309  __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));
    -
    2310  __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));
    -
    2311 
    -
    2312  // rounding biases in column/row passes, see stbi__idct_block for explanation.
    -
    2313  __m128i bias_0 = _mm_set1_epi32(512);
    -
    2314  __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));
    -
    2315 
    -
    2316  // load
    -
    2317  row0 = _mm_load_si128((const __m128i *) (data + 0*8));
    -
    2318  row1 = _mm_load_si128((const __m128i *) (data + 1*8));
    -
    2319  row2 = _mm_load_si128((const __m128i *) (data + 2*8));
    -
    2320  row3 = _mm_load_si128((const __m128i *) (data + 3*8));
    -
    2321  row4 = _mm_load_si128((const __m128i *) (data + 4*8));
    -
    2322  row5 = _mm_load_si128((const __m128i *) (data + 5*8));
    -
    2323  row6 = _mm_load_si128((const __m128i *) (data + 6*8));
    -
    2324  row7 = _mm_load_si128((const __m128i *) (data + 7*8));
    -
    2325 
    -
    2326  // column pass
    -
    2327  dct_pass(bias_0, 10);
    -
    2328 
    -
    2329  {
    -
    2330  // 16bit 8x8 transpose pass 1
    -
    2331  dct_interleave16(row0, row4);
    -
    2332  dct_interleave16(row1, row5);
    -
    2333  dct_interleave16(row2, row6);
    -
    2334  dct_interleave16(row3, row7);
    -
    2335 
    -
    2336  // transpose pass 2
    -
    2337  dct_interleave16(row0, row2);
    -
    2338  dct_interleave16(row1, row3);
    -
    2339  dct_interleave16(row4, row6);
    -
    2340  dct_interleave16(row5, row7);
    -
    2341 
    -
    2342  // transpose pass 3
    -
    2343  dct_interleave16(row0, row1);
    -
    2344  dct_interleave16(row2, row3);
    -
    2345  dct_interleave16(row4, row5);
    -
    2346  dct_interleave16(row6, row7);
    -
    2347  }
    -
    2348 
    -
    2349  // row pass
    -
    2350  dct_pass(bias_1, 17);
    -
    2351 
    -
    2352  {
    -
    2353  // pack
    -
    2354  __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
    -
    2355  __m128i p1 = _mm_packus_epi16(row2, row3);
    -
    2356  __m128i p2 = _mm_packus_epi16(row4, row5);
    -
    2357  __m128i p3 = _mm_packus_epi16(row6, row7);
    -
    2358 
    -
    2359  // 8bit 8x8 transpose pass 1
    -
    2360  dct_interleave8(p0, p2); // a0e0a1e1...
    -
    2361  dct_interleave8(p1, p3); // c0g0c1g1...
    -
    2362 
    -
    2363  // transpose pass 2
    -
    2364  dct_interleave8(p0, p1); // a0c0e0g0...
    -
    2365  dct_interleave8(p2, p3); // b0d0f0h0...
    -
    2366 
    -
    2367  // transpose pass 3
    -
    2368  dct_interleave8(p0, p2); // a0b0c0d0...
    -
    2369  dct_interleave8(p1, p3); // a4b4c4d4...
    -
    2370 
    -
    2371  // store
    -
    2372  _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
    -
    2373  _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
    -
    2374  _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
    -
    2375  _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
    -
    2376  _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
    -
    2377  _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
    -
    2378  _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
    -
    2379  _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
    -
    2380  }
    -
    2381 
    -
    2382 #undef dct_const
    -
    2383 #undef dct_rot
    -
    2384 #undef dct_widen
    -
    2385 #undef dct_wadd
    -
    2386 #undef dct_wsub
    -
    2387 #undef dct_bfly32o
    -
    2388 #undef dct_interleave8
    -
    2389 #undef dct_interleave16
    -
    2390 #undef dct_pass
    -
    2391 }
    -
    2392 
    -
    2393 #endif // STBI_SSE2
    -
    2394 
    -
    2395 #ifdef STBI_NEON
    -
    2396 
    -
    2397 // NEON integer IDCT. should produce bit-identical
    -
    2398 // results to the generic C version.
    -
    2399 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
    -
    2400 {
    -
    2401  int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;
    -
    2402 
    -
    2403  int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));
    -
    2404  int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));
    -
    2405  int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));
    -
    2406  int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));
    -
    2407  int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));
    -
    2408  int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));
    -
    2409  int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));
    -
    2410  int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));
    -
    2411  int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));
    -
    2412  int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));
    -
    2413  int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));
    -
    2414  int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));
    -
    2415 
    -
    2416 #define dct_long_mul(out, inq, coeff) \
    -
    2417  int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
    -
    2418  int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
    +
    2224  dc = j->img_comp[b].dc_pred + diff;
    +
    2225  j->img_comp[b].dc_pred = dc;
    +
    2226  data[0] = (short)(dc << j->succ_low);
    +
    2227  } else {
    +
    2228  // refinement scan for DC coefficient
    +
    2229  if (stbi__jpeg_get_bit(j))
    +
    2230  data[0] += (short)(1 << j->succ_low);
    +
    2231  }
    +
    2232  return 1;
    +
    2233 }
    +
    2234 
    +
    2235 // @OPTIMIZE: store non-zigzagged during the decode passes,
    +
    2236 // and only de-zigzag when dequantizing
    +
    2237 static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64],
    +
    2238  stbi__huffman *hac, stbi__int16 *fac)
    +
    2239 {
    +
    2240  int k;
    +
    2241  if (j->spec_start == 0)
    +
    2242  return stbi__err("can't merge dc and ac", "Corrupt JPEG");
    +
    2243 
    +
    2244  if (j->succ_high == 0) {
    +
    2245  int shift = j->succ_low;
    +
    2246 
    +
    2247  if (j->eob_run) {
    +
    2248  --j->eob_run;
    +
    2249  return 1;
    +
    2250  }
    +
    2251 
    +
    2252  k = j->spec_start;
    +
    2253  do {
    +
    2254  unsigned int zig;
    +
    2255  int c, r, s;
    +
    2256  if (j->code_bits < 16)
    +
    2257  stbi__grow_buffer_unsafe(j);
    +
    2258  c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS) - 1);
    +
    2259  r = fac[c];
    +
    2260  if (r) { // fast-AC path
    +
    2261  k += (r >> 4) & 15; // run
    +
    2262  s = r & 15; // combined length
    +
    2263  j->code_buffer <<= s;
    +
    2264  j->code_bits -= s;
    +
    2265  zig = stbi__jpeg_dezigzag[k++];
    +
    2266  data[zig] = (short)((r >> 8) << shift);
    +
    2267  } else {
    +
    2268  int rs = stbi__jpeg_huff_decode(j, hac);
    +
    2269  if (rs < 0)
    +
    2270  return stbi__err("bad huffman code", "Corrupt JPEG");
    +
    2271  s = rs & 15;
    +
    2272  r = rs >> 4;
    +
    2273  if (s == 0) {
    +
    2274  if (r < 15) {
    +
    2275  j->eob_run = (1 << r);
    +
    2276  if (r)
    +
    2277  j->eob_run += stbi__jpeg_get_bits(j, r);
    +
    2278  --j->eob_run;
    +
    2279  break;
    +
    2280  }
    +
    2281  k += 16;
    +
    2282  } else {
    +
    2283  k += r;
    +
    2284  zig = stbi__jpeg_dezigzag[k++];
    +
    2285  data[zig] = (short)(stbi__extend_receive(j, s) << shift);
    +
    2286  }
    +
    2287  }
    +
    2288  } while (k <= j->spec_end);
    +
    2289  } else {
    +
    2290  // refinement scan for these AC coefficients
    +
    2291 
    +
    2292  short bit = (short)(1 << j->succ_low);
    +
    2293 
    +
    2294  if (j->eob_run) {
    +
    2295  --j->eob_run;
    +
    2296  for (k = j->spec_start; k <= j->spec_end; ++k) {
    +
    2297  short *p = &data[stbi__jpeg_dezigzag[k]];
    +
    2298  if (*p != 0)
    +
    2299  if (stbi__jpeg_get_bit(j))
    +
    2300  if ((*p & bit) == 0) {
    +
    2301  if (*p > 0)
    +
    2302  *p += bit;
    +
    2303  else
    +
    2304  *p -= bit;
    +
    2305  }
    +
    2306  }
    +
    2307  } else {
    +
    2308  k = j->spec_start;
    +
    2309  do {
    +
    2310  int r, s;
    +
    2311  int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we
    +
    2312  // can use the fast
    +
    2313  // path here,
    +
    2314  // advance-by-r is so
    +
    2315  // slow, eh
    +
    2316  if (rs < 0)
    +
    2317  return stbi__err("bad huffman code", "Corrupt JPEG");
    +
    2318  s = rs & 15;
    +
    2319  r = rs >> 4;
    +
    2320  if (s == 0) {
    +
    2321  if (r < 15) {
    +
    2322  j->eob_run = (1 << r) - 1;
    +
    2323  if (r)
    +
    2324  j->eob_run += stbi__jpeg_get_bits(j, r);
    +
    2325  r = 64; // force end of block
    +
    2326  } else {
    +
    2327  // r=15 s=0 should write 16 0s, so we just do
    +
    2328  // a run of 15 0s and then write s (which is 0),
    +
    2329  // so we don't have to do anything special here
    +
    2330  }
    +
    2331  } else {
    +
    2332  if (s != 1)
    +
    2333  return stbi__err("bad huffman code", "Corrupt JPEG");
    +
    2334  // sign bit
    +
    2335  if (stbi__jpeg_get_bit(j))
    +
    2336  s = bit;
    +
    2337  else
    +
    2338  s = -bit;
    +
    2339  }
    +
    2340 
    +
    2341  // advance by r
    +
    2342  while (k <= j->spec_end) {
    +
    2343  short *p = &data[stbi__jpeg_dezigzag[k++]];
    +
    2344  if (*p != 0) {
    +
    2345  if (stbi__jpeg_get_bit(j))
    +
    2346  if ((*p & bit) == 0) {
    +
    2347  if (*p > 0)
    +
    2348  *p += bit;
    +
    2349  else
    +
    2350  *p -= bit;
    +
    2351  }
    +
    2352  } else {
    +
    2353  if (r == 0) {
    +
    2354  *p = (short)s;
    +
    2355  break;
    +
    2356  }
    +
    2357  --r;
    +
    2358  }
    +
    2359  }
    +
    2360  } while (k <= j->spec_end);
    +
    2361  }
    +
    2362  }
    +
    2363  return 1;
    +
    2364 }
    +
    2365 
    +
    2366 // take a -128..127 value and stbi__clamp it and convert to 0..255
    +
    2367 stbi_inline static stbi_uc stbi__clamp(int x)
    +
    2368 {
    +
    2369  // trick to use a single test to catch both cases
    +
    2370  if ((unsigned int)x > 255) {
    +
    2371  if (x < 0)
    +
    2372  return 0;
    +
    2373  if (x > 255)
    +
    2374  return 255;
    +
    2375  }
    +
    2376  return (stbi_uc)x;
    +
    2377 }
    +
    2378 
    +
    2379 #define stbi__f2f(x) ((int)(((x)*4096 + 0.5)))
    +
    2380 #define stbi__fsh(x) ((x) << 12)
    +
    2381 
    +
    2382 // derived from jidctint -- DCT_ISLOW
    +
    2383 #define STBI__IDCT_1D(s0, s1, s2, s3, s4, s5, s6, s7) \
    +
    2384  int t0, t1, t2, t3, p1, p2, p3, p4, p5, x0, x1, x2, x3; \
    +
    2385  p2 = s2; \
    +
    2386  p3 = s6; \
    +
    2387  p1 = (p2 + p3) * stbi__f2f(0.5411961f); \
    +
    2388  t2 = p1 + p3 * stbi__f2f(-1.847759065f); \
    +
    2389  t3 = p1 + p2 * stbi__f2f(0.765366865f); \
    +
    2390  p2 = s0; \
    +
    2391  p3 = s4; \
    +
    2392  t0 = stbi__fsh(p2 + p3); \
    +
    2393  t1 = stbi__fsh(p2 - p3); \
    +
    2394  x0 = t0 + t3; \
    +
    2395  x3 = t0 - t3; \
    +
    2396  x1 = t1 + t2; \
    +
    2397  x2 = t1 - t2; \
    +
    2398  t0 = s7; \
    +
    2399  t1 = s5; \
    +
    2400  t2 = s3; \
    +
    2401  t3 = s1; \
    +
    2402  p3 = t0 + t2; \
    +
    2403  p4 = t1 + t3; \
    +
    2404  p1 = t0 + t3; \
    +
    2405  p2 = t1 + t2; \
    +
    2406  p5 = (p3 + p4) * stbi__f2f(1.175875602f); \
    +
    2407  t0 = t0 * stbi__f2f(0.298631336f); \
    +
    2408  t1 = t1 * stbi__f2f(2.053119869f); \
    +
    2409  t2 = t2 * stbi__f2f(3.072711026f); \
    +
    2410  t3 = t3 * stbi__f2f(1.501321110f); \
    +
    2411  p1 = p5 + p1 * stbi__f2f(-0.899976223f); \
    +
    2412  p2 = p5 + p2 * stbi__f2f(-2.562915447f); \
    +
    2413  p3 = p3 * stbi__f2f(-1.961570560f); \
    +
    2414  p4 = p4 * stbi__f2f(-0.390180644f); \
    +
    2415  t3 += p1 + p4; \
    +
    2416  t2 += p2 + p3; \
    +
    2417  t1 += p2 + p4; \
    +
    2418  t0 += p1 + p3;
    2419 
    -
    2420 #define dct_long_mac(out, acc, inq, coeff) \
    -
    2421  int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
    -
    2422  int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
    -
    2423 
    -
    2424 #define dct_widen(out, inq) \
    -
    2425  int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
    -
    2426  int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
    -
    2427 
    -
    2428 // wide add
    -
    2429 #define dct_wadd(out, a, b) \
    -
    2430  int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
    -
    2431  int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
    -
    2432 
    -
    2433 // wide sub
    -
    2434 #define dct_wsub(out, a, b) \
    -
    2435  int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
    -
    2436  int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
    -
    2437 
    -
    2438 // butterfly a/b, then shift using "shiftop" by "s" and pack
    -
    2439 #define dct_bfly32o(out0,out1, a,b,shiftop,s) \
    -
    2440  { \
    -
    2441  dct_wadd(sum, a, b); \
    -
    2442  dct_wsub(dif, a, b); \
    -
    2443  out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \
    -
    2444  out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \
    -
    2445  }
    -
    2446 
    -
    2447 #define dct_pass(shiftop, shift) \
    -
    2448  { \
    -
    2449  /* even part */ \
    -
    2450  int16x8_t sum26 = vaddq_s16(row2, row6); \
    -
    2451  dct_long_mul(p1e, sum26, rot0_0); \
    -
    2452  dct_long_mac(t2e, p1e, row6, rot0_1); \
    -
    2453  dct_long_mac(t3e, p1e, row2, rot0_2); \
    -
    2454  int16x8_t sum04 = vaddq_s16(row0, row4); \
    -
    2455  int16x8_t dif04 = vsubq_s16(row0, row4); \
    -
    2456  dct_widen(t0e, sum04); \
    -
    2457  dct_widen(t1e, dif04); \
    -
    2458  dct_wadd(x0, t0e, t3e); \
    -
    2459  dct_wsub(x3, t0e, t3e); \
    -
    2460  dct_wadd(x1, t1e, t2e); \
    -
    2461  dct_wsub(x2, t1e, t2e); \
    -
    2462  /* odd part */ \
    -
    2463  int16x8_t sum15 = vaddq_s16(row1, row5); \
    -
    2464  int16x8_t sum17 = vaddq_s16(row1, row7); \
    -
    2465  int16x8_t sum35 = vaddq_s16(row3, row5); \
    -
    2466  int16x8_t sum37 = vaddq_s16(row3, row7); \
    -
    2467  int16x8_t sumodd = vaddq_s16(sum17, sum35); \
    -
    2468  dct_long_mul(p5o, sumodd, rot1_0); \
    -
    2469  dct_long_mac(p1o, p5o, sum17, rot1_1); \
    -
    2470  dct_long_mac(p2o, p5o, sum35, rot1_2); \
    -
    2471  dct_long_mul(p3o, sum37, rot2_0); \
    -
    2472  dct_long_mul(p4o, sum15, rot2_1); \
    -
    2473  dct_wadd(sump13o, p1o, p3o); \
    -
    2474  dct_wadd(sump24o, p2o, p4o); \
    -
    2475  dct_wadd(sump23o, p2o, p3o); \
    -
    2476  dct_wadd(sump14o, p1o, p4o); \
    -
    2477  dct_long_mac(x4, sump13o, row7, rot3_0); \
    -
    2478  dct_long_mac(x5, sump24o, row5, rot3_1); \
    -
    2479  dct_long_mac(x6, sump23o, row3, rot3_2); \
    -
    2480  dct_long_mac(x7, sump14o, row1, rot3_3); \
    -
    2481  dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \
    -
    2482  dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \
    -
    2483  dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \
    -
    2484  dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \
    -
    2485  }
    -
    2486 
    -
    2487  // load
    -
    2488  row0 = vld1q_s16(data + 0*8);
    -
    2489  row1 = vld1q_s16(data + 1*8);
    -
    2490  row2 = vld1q_s16(data + 2*8);
    -
    2491  row3 = vld1q_s16(data + 3*8);
    -
    2492  row4 = vld1q_s16(data + 4*8);
    -
    2493  row5 = vld1q_s16(data + 5*8);
    -
    2494  row6 = vld1q_s16(data + 6*8);
    -
    2495  row7 = vld1q_s16(data + 7*8);
    -
    2496 
    -
    2497  // add DC bias
    -
    2498  row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));
    -
    2499 
    -
    2500  // column pass
    -
    2501  dct_pass(vrshrn_n_s32, 10);
    -
    2502 
    -
    2503  // 16bit 8x8 transpose
    -
    2504  {
    -
    2505 // these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.
    -
    2506 // whether compilers actually get this is another story, sadly.
    -
    2507 #define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }
    -
    2508 #define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }
    -
    2509 #define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }
    -
    2510 
    -
    2511  // pass 1
    -
    2512  dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6
    -
    2513  dct_trn16(row2, row3);
    -
    2514  dct_trn16(row4, row5);
    -
    2515  dct_trn16(row6, row7);
    -
    2516 
    -
    2517  // pass 2
    -
    2518  dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4
    -
    2519  dct_trn32(row1, row3);
    -
    2520  dct_trn32(row4, row6);
    -
    2521  dct_trn32(row5, row7);
    -
    2522 
    -
    2523  // pass 3
    -
    2524  dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0
    -
    2525  dct_trn64(row1, row5);
    -
    2526  dct_trn64(row2, row6);
    -
    2527  dct_trn64(row3, row7);
    -
    2528 
    -
    2529 #undef dct_trn16
    -
    2530 #undef dct_trn32
    -
    2531 #undef dct_trn64
    -
    2532  }
    -
    2533 
    -
    2534  // row pass
    -
    2535  // vrshrn_n_s32 only supports shifts up to 16, we need
    -
    2536  // 17. so do a non-rounding shift of 16 first then follow
    -
    2537  // up with a rounding shift by 1.
    -
    2538  dct_pass(vshrn_n_s32, 16);
    -
    2539 
    -
    2540  {
    -
    2541  // pack and round
    -
    2542  uint8x8_t p0 = vqrshrun_n_s16(row0, 1);
    -
    2543  uint8x8_t p1 = vqrshrun_n_s16(row1, 1);
    -
    2544  uint8x8_t p2 = vqrshrun_n_s16(row2, 1);
    -
    2545  uint8x8_t p3 = vqrshrun_n_s16(row3, 1);
    -
    2546  uint8x8_t p4 = vqrshrun_n_s16(row4, 1);
    -
    2547  uint8x8_t p5 = vqrshrun_n_s16(row5, 1);
    -
    2548  uint8x8_t p6 = vqrshrun_n_s16(row6, 1);
    -
    2549  uint8x8_t p7 = vqrshrun_n_s16(row7, 1);
    -
    2550 
    -
    2551  // again, these can translate into one instruction, but often don't.
    -
    2552 #define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }
    -
    2553 #define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }
    -
    2554 #define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }
    -
    2555 
    -
    2556  // sadly can't use interleaved stores here since we only write
    -
    2557  // 8 bytes to each scan line!
    -
    2558 
    -
    2559  // 8x8 8-bit transpose pass 1
    -
    2560  dct_trn8_8(p0, p1);
    -
    2561  dct_trn8_8(p2, p3);
    -
    2562  dct_trn8_8(p4, p5);
    -
    2563  dct_trn8_8(p6, p7);
    -
    2564 
    -
    2565  // pass 2
    -
    2566  dct_trn8_16(p0, p2);
    -
    2567  dct_trn8_16(p1, p3);
    -
    2568  dct_trn8_16(p4, p6);
    -
    2569  dct_trn8_16(p5, p7);
    -
    2570 
    -
    2571  // pass 3
    -
    2572  dct_trn8_32(p0, p4);
    -
    2573  dct_trn8_32(p1, p5);
    -
    2574  dct_trn8_32(p2, p6);
    -
    2575  dct_trn8_32(p3, p7);
    -
    2576 
    -
    2577  // store
    -
    2578  vst1_u8(out, p0); out += out_stride;
    -
    2579  vst1_u8(out, p1); out += out_stride;
    -
    2580  vst1_u8(out, p2); out += out_stride;
    -
    2581  vst1_u8(out, p3); out += out_stride;
    -
    2582  vst1_u8(out, p4); out += out_stride;
    -
    2583  vst1_u8(out, p5); out += out_stride;
    -
    2584  vst1_u8(out, p6); out += out_stride;
    -
    2585  vst1_u8(out, p7);
    -
    2586 
    -
    2587 #undef dct_trn8_8
    -
    2588 #undef dct_trn8_16
    -
    2589 #undef dct_trn8_32
    -
    2590  }
    -
    2591 
    -
    2592 #undef dct_long_mul
    -
    2593 #undef dct_long_mac
    -
    2594 #undef dct_widen
    -
    2595 #undef dct_wadd
    -
    2596 #undef dct_wsub
    -
    2597 #undef dct_bfly32o
    -
    2598 #undef dct_pass
    -
    2599 }
    -
    2600 
    -
    2601 #endif // STBI_NEON
    -
    2602 
    -
    2603 #define STBI__MARKER_none 0xff
    -
    2604 // if there's a pending marker from the entropy stream, return that
    -
    2605 // otherwise, fetch from the stream and get a marker. if there's no
    -
    2606 // marker, return 0xff, which is never a valid marker value
    -
    2607 static stbi_uc stbi__get_marker(stbi__jpeg *j)
    -
    2608 {
    -
    2609  stbi_uc x;
    -
    2610  if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }
    -
    2611  x = stbi__get8(j->s);
    -
    2612  if (x != 0xff) return STBI__MARKER_none;
    -
    2613  while (x == 0xff)
    -
    2614  x = stbi__get8(j->s); // consume repeated 0xff fill bytes
    -
    2615  return x;
    -
    2616 }
    +
    2420 static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
    +
    2421 {
    +
    2422  int i, val[64], *v = val;
    +
    2423  stbi_uc *o;
    +
    2424  short *d = data;
    +
    2425 
    +
    2426  // columns
    +
    2427  for (i = 0; i < 8; ++i, ++d, ++v) {
    +
    2428  // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
    +
    2429  if (d[8] == 0 && d[16] == 0 && d[24] == 0 && d[32] == 0 && d[40] == 0 &&
    +
    2430  d[48] == 0 && d[56] == 0) {
    +
    2431  // no shortcut 0 seconds
    +
    2432  // (1|2|3|4|5|6|7)==0 0 seconds
    +
    2433  // all separate -0.047 seconds
    +
    2434  // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
    +
    2435  int dcterm = d[0] << 2;
    +
    2436  v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] =
    +
    2437  dcterm;
    +
    2438  } else {
    +
    2439  STBI__IDCT_1D(d[0], d[8], d[16], d[24], d[32], d[40], d[48], d[56])
    +
    2440  // constants scaled things up by 1<<12; let's bring them back
    +
    2441  // down, but keep 2 extra bits of precision
    +
    2442  x0 += 512;
    +
    2443  x1 += 512;
    +
    2444  x2 += 512;
    +
    2445  x3 += 512;
    +
    2446  v[0] = (x0 + t3) >> 10;
    +
    2447  v[56] = (x0 - t3) >> 10;
    +
    2448  v[8] = (x1 + t2) >> 10;
    +
    2449  v[48] = (x1 - t2) >> 10;
    +
    2450  v[16] = (x2 + t1) >> 10;
    +
    2451  v[40] = (x2 - t1) >> 10;
    +
    2452  v[24] = (x3 + t0) >> 10;
    +
    2453  v[32] = (x3 - t0) >> 10;
    +
    2454  }
    +
    2455  }
    +
    2456 
    +
    2457  for (i = 0, v = val, o = out; i < 8; ++i, v += 8, o += out_stride) {
    +
    2458  // no fast case since the first 1D IDCT spread components out
    +
    2459  STBI__IDCT_1D(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    +
    2460  // constants scaled things up by 1<<12, plus we had 1<<2 from first
    +
    2461  // loop, plus horizontal and vertical each scale by sqrt(8) so together
    +
    2462  // we've got an extra 1<<3, so 1<<17 total we need to remove.
    +
    2463  // so we want to round that, which means adding 0.5 * 1<<17,
    +
    2464  // aka 65536. Also, we'll end up with -128 to 127 that we want
    +
    2465  // to encode as 0..255 by adding 128, so we'll add that before the shift
    +
    2466  x0 += 65536 + (128 << 17);
    +
    2467  x1 += 65536 + (128 << 17);
    +
    2468  x2 += 65536 + (128 << 17);
    +
    2469  x3 += 65536 + (128 << 17);
    +
    2470  // tried computing the shifts into temps, or'ing the temps to see
    +
    2471  // if any were out of range, but that was slower
    +
    2472  o[0] = stbi__clamp((x0 + t3) >> 17);
    +
    2473  o[7] = stbi__clamp((x0 - t3) >> 17);
    +
    2474  o[1] = stbi__clamp((x1 + t2) >> 17);
    +
    2475  o[6] = stbi__clamp((x1 - t2) >> 17);
    +
    2476  o[2] = stbi__clamp((x2 + t1) >> 17);
    +
    2477  o[5] = stbi__clamp((x2 - t1) >> 17);
    +
    2478  o[3] = stbi__clamp((x3 + t0) >> 17);
    +
    2479  o[4] = stbi__clamp((x3 - t0) >> 17);
    +
    2480  }
    +
    2481 }
    +
    2482 
    +
    2483 #ifdef STBI_SSE2
    +
    2484 // sse2 integer IDCT. not the fastest possible implementation but it
    +
    2485 // produces bit-identical results to the generic C version so it's
    +
    2486 // fully "transparent".
    +
    2487 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
    +
    2488 {
    +
    2489  // This is constructed to match our regular (generic) integer IDCT exactly.
    +
    2490  __m128i row0, row1, row2, row3, row4, row5, row6, row7;
    +
    2491  __m128i tmp;
    +
    2492 
    +
    2493 // dot product constant: even elems=x, odd elems=y
    +
    2494 #define dct_const(x, y) _mm_setr_epi16((x), (y), (x), (y), (x), (y), (x), (y))
    +
    2495 
    +
    2496 // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
    +
    2497 // out(1) = c1[even]*x + c1[odd]*y
    +
    2498 #define dct_rot(out0, out1, x, y, c0, c1) \
    +
    2499  __m128i c0##lo = _mm_unpacklo_epi16((x), (y)); \
    +
    2500  __m128i c0##hi = _mm_unpackhi_epi16((x), (y)); \
    +
    2501  __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
    +
    2502  __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
    +
    2503  __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
    +
    2504  __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
    +
    2505 
    +
    2506 // out = in << 12 (in 16-bit, out 32-bit)
    +
    2507 #define dct_widen(out, in) \
    +
    2508  __m128i out##_l = \
    +
    2509  _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
    +
    2510  __m128i out##_h = \
    +
    2511  _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
    +
    2512 
    +
    2513 // wide add
    +
    2514 #define dct_wadd(out, a, b) \
    +
    2515  __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
    +
    2516  __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
    +
    2517 
    +
    2518 // wide sub
    +
    2519 #define dct_wsub(out, a, b) \
    +
    2520  __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
    +
    2521  __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
    +
    2522 
    +
    2523 // butterfly a/b, add bias, then shift by "s" and pack
    +
    2524 #define dct_bfly32o(out0, out1, a, b, bias, s) \
    +
    2525  { \
    +
    2526  __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
    +
    2527  __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
    +
    2528  dct_wadd(sum, abiased, b); \
    +
    2529  dct_wsub(dif, abiased, b); \
    +
    2530  out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), \
    +
    2531  _mm_srai_epi32(sum_h, s)); \
    +
    2532  out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), \
    +
    2533  _mm_srai_epi32(dif_h, s)); \
    +
    2534  }
    +
    2535 
    +
    2536 // 8-bit interleave step (for transposes)
    +
    2537 #define dct_interleave8(a, b) \
    +
    2538  tmp = a; \
    +
    2539  a = _mm_unpacklo_epi8(a, b); \
    +
    2540  b = _mm_unpackhi_epi8(tmp, b)
    +
    2541 
    +
    2542 // 16-bit interleave step (for transposes)
    +
    2543 #define dct_interleave16(a, b) \
    +
    2544  tmp = a; \
    +
    2545  a = _mm_unpacklo_epi16(a, b); \
    +
    2546  b = _mm_unpackhi_epi16(tmp, b)
    +
    2547 
    +
    2548 #define dct_pass(bias, shift) \
    +
    2549  { \
    +
    2550  /* even part */ \
    +
    2551  dct_rot(t2e, t3e, row2, row6, rot0_0, rot0_1); \
    +
    2552  __m128i sum04 = _mm_add_epi16(row0, row4); \
    +
    2553  __m128i dif04 = _mm_sub_epi16(row0, row4); \
    +
    2554  dct_widen(t0e, sum04); \
    +
    2555  dct_widen(t1e, dif04); \
    +
    2556  dct_wadd(x0, t0e, t3e); \
    +
    2557  dct_wsub(x3, t0e, t3e); \
    +
    2558  dct_wadd(x1, t1e, t2e); \
    +
    2559  dct_wsub(x2, t1e, t2e); \
    +
    2560  /* odd part */ \
    +
    2561  dct_rot(y0o, y2o, row7, row3, rot2_0, rot2_1); \
    +
    2562  dct_rot(y1o, y3o, row5, row1, rot3_0, rot3_1); \
    +
    2563  __m128i sum17 = _mm_add_epi16(row1, row7); \
    +
    2564  __m128i sum35 = _mm_add_epi16(row3, row5); \
    +
    2565  dct_rot(y4o, y5o, sum17, sum35, rot1_0, rot1_1); \
    +
    2566  dct_wadd(x4, y0o, y4o); \
    +
    2567  dct_wadd(x5, y1o, y5o); \
    +
    2568  dct_wadd(x6, y2o, y5o); \
    +
    2569  dct_wadd(x7, y3o, y4o); \
    +
    2570  dct_bfly32o(row0, row7, x0, x7, bias, shift); \
    +
    2571  dct_bfly32o(row1, row6, x1, x6, bias, shift); \
    +
    2572  dct_bfly32o(row2, row5, x2, x5, bias, shift); \
    +
    2573  dct_bfly32o(row3, row4, x3, x4, bias, shift); \
    +
    2574  }
    +
    2575 
    +
    2576  __m128i rot0_0 =
    +
    2577  dct_const(stbi__f2f(0.5411961f),
    +
    2578  stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
    +
    2579  __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f(0.765366865f),
    +
    2580  stbi__f2f(0.5411961f));
    +
    2581  __m128i rot1_0 =
    +
    2582  dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f),
    +
    2583  stbi__f2f(1.175875602f));
    +
    2584  __m128i rot1_1 =
    +
    2585  dct_const(stbi__f2f(1.175875602f),
    +
    2586  stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
    +
    2587  __m128i rot2_0 =
    +
    2588  dct_const(stbi__f2f(-1.961570560f) + stbi__f2f(0.298631336f),
    +
    2589  stbi__f2f(-1.961570560f));
    +
    2590  __m128i rot2_1 =
    +
    2591  dct_const(stbi__f2f(-1.961570560f),
    +
    2592  stbi__f2f(-1.961570560f) + stbi__f2f(3.072711026f));
    +
    2593  __m128i rot3_0 =
    +
    2594  dct_const(stbi__f2f(-0.390180644f) + stbi__f2f(2.053119869f),
    +
    2595  stbi__f2f(-0.390180644f));
    +
    2596  __m128i rot3_1 =
    +
    2597  dct_const(stbi__f2f(-0.390180644f),
    +
    2598  stbi__f2f(-0.390180644f) + stbi__f2f(1.501321110f));
    +
    2599 
    +
    2600  // rounding biases in column/row passes, see stbi__idct_block for
    +
    2601  // explanation.
    +
    2602  __m128i bias_0 = _mm_set1_epi32(512);
    +
    2603  __m128i bias_1 = _mm_set1_epi32(65536 + (128 << 17));
    +
    2604 
    +
    2605  // load
    +
    2606  row0 = _mm_load_si128((const __m128i *)(data + 0 * 8));
    +
    2607  row1 = _mm_load_si128((const __m128i *)(data + 1 * 8));
    +
    2608  row2 = _mm_load_si128((const __m128i *)(data + 2 * 8));
    +
    2609  row3 = _mm_load_si128((const __m128i *)(data + 3 * 8));
    +
    2610  row4 = _mm_load_si128((const __m128i *)(data + 4 * 8));
    +
    2611  row5 = _mm_load_si128((const __m128i *)(data + 5 * 8));
    +
    2612  row6 = _mm_load_si128((const __m128i *)(data + 6 * 8));
    +
    2613  row7 = _mm_load_si128((const __m128i *)(data + 7 * 8));
    +
    2614 
    +
    2615  // column pass
    +
    2616  dct_pass(bias_0, 10);
    2617 
    -
    2618 // in each scan, we'll have scan_n components, and the order
    -
    2619 // of the components is specified by order[]
    -
    2620 #define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
    -
    2621 
    -
    2622 // after a restart interval, stbi__jpeg_reset the entropy decoder and
    -
    2623 // the dc prediction
    -
    2624 static void stbi__jpeg_reset(stbi__jpeg *j)
    -
    2625 {
    -
    2626  j->code_bits = 0;
    -
    2627  j->code_buffer = 0;
    -
    2628  j->nomore = 0;
    -
    2629  j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = j->img_comp[3].dc_pred = 0;
    -
    2630  j->marker = STBI__MARKER_none;
    -
    2631  j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
    -
    2632  j->eob_run = 0;
    -
    2633  // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
    -
    2634  // since we don't even allow 1<<30 pixels
    -
    2635 }
    -
    2636 
    -
    2637 static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
    -
    2638 {
    -
    2639  stbi__jpeg_reset(z);
    -
    2640  if (!z->progressive) {
    -
    2641  if (z->scan_n == 1) {
    -
    2642  int i,j;
    -
    2643  STBI_SIMD_ALIGN(short, data[64]);
    -
    2644  int n = z->order[0];
    -
    2645  // non-interleaved data, we just need to process one block at a time,
    -
    2646  // in trivial scanline order
    -
    2647  // number of blocks to do just depends on how many actual "pixels" this
    -
    2648  // component has, independent of interleaved MCU blocking and such
    -
    2649  int w = (z->img_comp[n].x+7) >> 3;
    -
    2650  int h = (z->img_comp[n].y+7) >> 3;
    -
    2651  for (j=0; j < h; ++j) {
    -
    2652  for (i=0; i < w; ++i) {
    -
    2653  int ha = z->img_comp[n].ha;
    -
    2654  if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
    -
    2655  z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
    -
    2656  // every data block is an MCU, so countdown the restart interval
    -
    2657  if (--z->todo <= 0) {
    -
    2658  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
    -
    2659  // if it's NOT a restart, then just bail, so we get corrupt data
    -
    2660  // rather than no data
    -
    2661  if (!STBI__RESTART(z->marker)) return 1;
    -
    2662  stbi__jpeg_reset(z);
    -
    2663  }
    -
    2664  }
    -
    2665  }
    -
    2666  return 1;
    -
    2667  } else { // interleaved
    -
    2668  int i,j,k,x,y;
    -
    2669  STBI_SIMD_ALIGN(short, data[64]);
    -
    2670  for (j=0; j < z->img_mcu_y; ++j) {
    -
    2671  for (i=0; i < z->img_mcu_x; ++i) {
    -
    2672  // scan an interleaved mcu... process scan_n components in order
    -
    2673  for (k=0; k < z->scan_n; ++k) {
    -
    2674  int n = z->order[k];
    -
    2675  // scan out an mcu's worth of this component; that's just determined
    -
    2676  // by the basic H and V specified for the component
    -
    2677  for (y=0; y < z->img_comp[n].v; ++y) {
    -
    2678  for (x=0; x < z->img_comp[n].h; ++x) {
    -
    2679  int x2 = (i*z->img_comp[n].h + x)*8;
    -
    2680  int y2 = (j*z->img_comp[n].v + y)*8;
    -
    2681  int ha = z->img_comp[n].ha;
    -
    2682  if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
    -
    2683  z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);
    -
    2684  }
    -
    2685  }
    -
    2686  }
    -
    2687  // after all interleaved components, that's an interleaved MCU,
    -
    2688  // so now count down the restart interval
    -
    2689  if (--z->todo <= 0) {
    -
    2690  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
    -
    2691  if (!STBI__RESTART(z->marker)) return 1;
    -
    2692  stbi__jpeg_reset(z);
    -
    2693  }
    -
    2694  }
    -
    2695  }
    -
    2696  return 1;
    -
    2697  }
    -
    2698  } else {
    -
    2699  if (z->scan_n == 1) {
    -
    2700  int i,j;
    -
    2701  int n = z->order[0];
    -
    2702  // non-interleaved data, we just need to process one block at a time,
    -
    2703  // in trivial scanline order
    -
    2704  // number of blocks to do just depends on how many actual "pixels" this
    -
    2705  // component has, independent of interleaved MCU blocking and such
    -
    2706  int w = (z->img_comp[n].x+7) >> 3;
    -
    2707  int h = (z->img_comp[n].y+7) >> 3;
    -
    2708  for (j=0; j < h; ++j) {
    -
    2709  for (i=0; i < w; ++i) {
    -
    2710  short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
    -
    2711  if (z->spec_start == 0) {
    -
    2712  if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
    -
    2713  return 0;
    -
    2714  } else {
    -
    2715  int ha = z->img_comp[n].ha;
    -
    2716  if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))
    -
    2717  return 0;
    -
    2718  }
    -
    2719  // every data block is an MCU, so countdown the restart interval
    -
    2720  if (--z->todo <= 0) {
    -
    2721  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
    -
    2722  if (!STBI__RESTART(z->marker)) return 1;
    -
    2723  stbi__jpeg_reset(z);
    -
    2724  }
    -
    2725  }
    -
    2726  }
    -
    2727  return 1;
    -
    2728  } else { // interleaved
    -
    2729  int i,j,k,x,y;
    -
    2730  for (j=0; j < z->img_mcu_y; ++j) {
    -
    2731  for (i=0; i < z->img_mcu_x; ++i) {
    -
    2732  // scan an interleaved mcu... process scan_n components in order
    -
    2733  for (k=0; k < z->scan_n; ++k) {
    -
    2734  int n = z->order[k];
    -
    2735  // scan out an mcu's worth of this component; that's just determined
    -
    2736  // by the basic H and V specified for the component
    -
    2737  for (y=0; y < z->img_comp[n].v; ++y) {
    -
    2738  for (x=0; x < z->img_comp[n].h; ++x) {
    -
    2739  int x2 = (i*z->img_comp[n].h + x);
    -
    2740  int y2 = (j*z->img_comp[n].v + y);
    -
    2741  short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);
    -
    2742  if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
    -
    2743  return 0;
    -
    2744  }
    -
    2745  }
    -
    2746  }
    -
    2747  // after all interleaved components, that's an interleaved MCU,
    -
    2748  // so now count down the restart interval
    -
    2749  if (--z->todo <= 0) {
    -
    2750  if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
    -
    2751  if (!STBI__RESTART(z->marker)) return 1;
    -
    2752  stbi__jpeg_reset(z);
    -
    2753  }
    -
    2754  }
    -
    2755  }
    -
    2756  return 1;
    -
    2757  }
    -
    2758  }
    -
    2759 }
    -
    2760 
    -
    2761 static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant)
    -
    2762 {
    -
    2763  int i;
    -
    2764  for (i=0; i < 64; ++i)
    -
    2765  data[i] *= dequant[i];
    -
    2766 }
    -
    2767 
    -
    2768 static void stbi__jpeg_finish(stbi__jpeg *z)
    -
    2769 {
    -
    2770  if (z->progressive) {
    -
    2771  // dequantize and idct the data
    -
    2772  int i,j,n;
    -
    2773  for (n=0; n < z->s->img_n; ++n) {
    -
    2774  int w = (z->img_comp[n].x+7) >> 3;
    -
    2775  int h = (z->img_comp[n].y+7) >> 3;
    -
    2776  for (j=0; j < h; ++j) {
    -
    2777  for (i=0; i < w; ++i) {
    -
    2778  short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
    -
    2779  stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
    -
    2780  z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
    -
    2781  }
    -
    2782  }
    -
    2783  }
    -
    2784  }
    -
    2785 }
    -
    2786 
    -
    2787 static int stbi__process_marker(stbi__jpeg *z, int m)
    -
    2788 {
    -
    2789  int L;
    -
    2790  switch (m) {
    -
    2791  case STBI__MARKER_none: // no marker found
    -
    2792  return stbi__err("expected marker","Corrupt JPEG");
    -
    2793 
    -
    2794  case 0xDD: // DRI - specify restart interval
    -
    2795  if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
    -
    2796  z->restart_interval = stbi__get16be(z->s);
    -
    2797  return 1;
    +
    2618  {
    +
    2619  // 16bit 8x8 transpose pass 1
    +
    2620  dct_interleave16(row0, row4);
    +
    2621  dct_interleave16(row1, row5);
    +
    2622  dct_interleave16(row2, row6);
    +
    2623  dct_interleave16(row3, row7);
    +
    2624 
    +
    2625  // transpose pass 2
    +
    2626  dct_interleave16(row0, row2);
    +
    2627  dct_interleave16(row1, row3);
    +
    2628  dct_interleave16(row4, row6);
    +
    2629  dct_interleave16(row5, row7);
    +
    2630 
    +
    2631  // transpose pass 3
    +
    2632  dct_interleave16(row0, row1);
    +
    2633  dct_interleave16(row2, row3);
    +
    2634  dct_interleave16(row4, row5);
    +
    2635  dct_interleave16(row6, row7);
    +
    2636  }
    +
    2637 
    +
    2638  // row pass
    +
    2639  dct_pass(bias_1, 17);
    +
    2640 
    +
    2641  {
    +
    2642  // pack
    +
    2643  __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
    +
    2644  __m128i p1 = _mm_packus_epi16(row2, row3);
    +
    2645  __m128i p2 = _mm_packus_epi16(row4, row5);
    +
    2646  __m128i p3 = _mm_packus_epi16(row6, row7);
    +
    2647 
    +
    2648  // 8bit 8x8 transpose pass 1
    +
    2649  dct_interleave8(p0, p2); // a0e0a1e1...
    +
    2650  dct_interleave8(p1, p3); // c0g0c1g1...
    +
    2651 
    +
    2652  // transpose pass 2
    +
    2653  dct_interleave8(p0, p1); // a0c0e0g0...
    +
    2654  dct_interleave8(p2, p3); // b0d0f0h0...
    +
    2655 
    +
    2656  // transpose pass 3
    +
    2657  dct_interleave8(p0, p2); // a0b0c0d0...
    +
    2658  dct_interleave8(p1, p3); // a4b4c4d4...
    +
    2659 
    +
    2660  // store
    +
    2661  _mm_storel_epi64((__m128i *)out, p0);
    +
    2662  out += out_stride;
    +
    2663  _mm_storel_epi64((__m128i *)out, _mm_shuffle_epi32(p0, 0x4e));
    +
    2664  out += out_stride;
    +
    2665  _mm_storel_epi64((__m128i *)out, p2);
    +
    2666  out += out_stride;
    +
    2667  _mm_storel_epi64((__m128i *)out, _mm_shuffle_epi32(p2, 0x4e));
    +
    2668  out += out_stride;
    +
    2669  _mm_storel_epi64((__m128i *)out, p1);
    +
    2670  out += out_stride;
    +
    2671  _mm_storel_epi64((__m128i *)out, _mm_shuffle_epi32(p1, 0x4e));
    +
    2672  out += out_stride;
    +
    2673  _mm_storel_epi64((__m128i *)out, p3);
    +
    2674  out += out_stride;
    +
    2675  _mm_storel_epi64((__m128i *)out, _mm_shuffle_epi32(p3, 0x4e));
    +
    2676  }
    +
    2677 
    +
    2678 #undef dct_const
    +
    2679 #undef dct_rot
    +
    2680 #undef dct_widen
    +
    2681 #undef dct_wadd
    +
    2682 #undef dct_wsub
    +
    2683 #undef dct_bfly32o
    +
    2684 #undef dct_interleave8
    +
    2685 #undef dct_interleave16
    +
    2686 #undef dct_pass
    +
    2687 }
    +
    2688 
    +
    2689 #endif // STBI_SSE2
    +
    2690 
    +
    2691 #ifdef STBI_NEON
    +
    2692 
    +
    2693 // NEON integer IDCT. should produce bit-identical
    +
    2694 // results to the generic C version.
    +
    2695 static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
    +
    2696 {
    +
    2697  int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;
    +
    2698 
    +
    2699  int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));
    +
    2700  int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));
    +
    2701  int16x4_t rot0_2 = vdup_n_s16(stbi__f2f(0.765366865f));
    +
    2702  int16x4_t rot1_0 = vdup_n_s16(stbi__f2f(1.175875602f));
    +
    2703  int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));
    +
    2704  int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));
    +
    2705  int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));
    +
    2706  int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));
    +
    2707  int16x4_t rot3_0 = vdup_n_s16(stbi__f2f(0.298631336f));
    +
    2708  int16x4_t rot3_1 = vdup_n_s16(stbi__f2f(2.053119869f));
    +
    2709  int16x4_t rot3_2 = vdup_n_s16(stbi__f2f(3.072711026f));
    +
    2710  int16x4_t rot3_3 = vdup_n_s16(stbi__f2f(1.501321110f));
    +
    2711 
    +
    2712 #define dct_long_mul(out, inq, coeff) \
    +
    2713  int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
    +
    2714  int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
    +
    2715 
    +
    2716 #define dct_long_mac(out, acc, inq, coeff) \
    +
    2717  int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
    +
    2718  int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
    +
    2719 
    +
    2720 #define dct_widen(out, inq) \
    +
    2721  int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
    +
    2722  int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
    +
    2723 
    +
    2724 // wide add
    +
    2725 #define dct_wadd(out, a, b) \
    +
    2726  int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
    +
    2727  int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
    +
    2728 
    +
    2729 // wide sub
    +
    2730 #define dct_wsub(out, a, b) \
    +
    2731  int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
    +
    2732  int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
    +
    2733 
    +
    2734 // butterfly a/b, then shift using "shiftop" by "s" and pack
    +
    2735 #define dct_bfly32o(out0, out1, a, b, shiftop, s) \
    +
    2736  { \
    +
    2737  dct_wadd(sum, a, b); \
    +
    2738  dct_wsub(dif, a, b); \
    +
    2739  out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \
    +
    2740  out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \
    +
    2741  }
    +
    2742 
    +
    2743 #define dct_pass(shiftop, shift) \
    +
    2744  { \
    +
    2745  /* even part */ \
    +
    2746  int16x8_t sum26 = vaddq_s16(row2, row6); \
    +
    2747  dct_long_mul(p1e, sum26, rot0_0); \
    +
    2748  dct_long_mac(t2e, p1e, row6, rot0_1); \
    +
    2749  dct_long_mac(t3e, p1e, row2, rot0_2); \
    +
    2750  int16x8_t sum04 = vaddq_s16(row0, row4); \
    +
    2751  int16x8_t dif04 = vsubq_s16(row0, row4); \
    +
    2752  dct_widen(t0e, sum04); \
    +
    2753  dct_widen(t1e, dif04); \
    +
    2754  dct_wadd(x0, t0e, t3e); \
    +
    2755  dct_wsub(x3, t0e, t3e); \
    +
    2756  dct_wadd(x1, t1e, t2e); \
    +
    2757  dct_wsub(x2, t1e, t2e); \
    +
    2758  /* odd part */ \
    +
    2759  int16x8_t sum15 = vaddq_s16(row1, row5); \
    +
    2760  int16x8_t sum17 = vaddq_s16(row1, row7); \
    +
    2761  int16x8_t sum35 = vaddq_s16(row3, row5); \
    +
    2762  int16x8_t sum37 = vaddq_s16(row3, row7); \
    +
    2763  int16x8_t sumodd = vaddq_s16(sum17, sum35); \
    +
    2764  dct_long_mul(p5o, sumodd, rot1_0); \
    +
    2765  dct_long_mac(p1o, p5o, sum17, rot1_1); \
    +
    2766  dct_long_mac(p2o, p5o, sum35, rot1_2); \
    +
    2767  dct_long_mul(p3o, sum37, rot2_0); \
    +
    2768  dct_long_mul(p4o, sum15, rot2_1); \
    +
    2769  dct_wadd(sump13o, p1o, p3o); \
    +
    2770  dct_wadd(sump24o, p2o, p4o); \
    +
    2771  dct_wadd(sump23o, p2o, p3o); \
    +
    2772  dct_wadd(sump14o, p1o, p4o); \
    +
    2773  dct_long_mac(x4, sump13o, row7, rot3_0); \
    +
    2774  dct_long_mac(x5, sump24o, row5, rot3_1); \
    +
    2775  dct_long_mac(x6, sump23o, row3, rot3_2); \
    +
    2776  dct_long_mac(x7, sump14o, row1, rot3_3); \
    +
    2777  dct_bfly32o(row0, row7, x0, x7, shiftop, shift); \
    +
    2778  dct_bfly32o(row1, row6, x1, x6, shiftop, shift); \
    +
    2779  dct_bfly32o(row2, row5, x2, x5, shiftop, shift); \
    +
    2780  dct_bfly32o(row3, row4, x3, x4, shiftop, shift); \
    +
    2781  }
    +
    2782 
    +
    2783  // load
    +
    2784  row0 = vld1q_s16(data + 0 * 8);
    +
    2785  row1 = vld1q_s16(data + 1 * 8);
    +
    2786  row2 = vld1q_s16(data + 2 * 8);
    +
    2787  row3 = vld1q_s16(data + 3 * 8);
    +
    2788  row4 = vld1q_s16(data + 4 * 8);
    +
    2789  row5 = vld1q_s16(data + 5 * 8);
    +
    2790  row6 = vld1q_s16(data + 6 * 8);
    +
    2791  row7 = vld1q_s16(data + 7 * 8);
    +
    2792 
    +
    2793  // add DC bias
    +
    2794  row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));
    +
    2795 
    +
    2796  // column pass
    +
    2797  dct_pass(vrshrn_n_s32, 10);
    2798 
    -
    2799  case 0xDB: // DQT - define quantization table
    -
    2800  L = stbi__get16be(z->s)-2;
    -
    2801  while (L > 0) {
    -
    2802  int q = stbi__get8(z->s);
    -
    2803  int p = q >> 4, sixteen = (p != 0);
    -
    2804  int t = q & 15,i;
    -
    2805  if (p != 0 && p != 1) return stbi__err("bad DQT type","Corrupt JPEG");
    -
    2806  if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
    -
    2807 
    -
    2808  for (i=0; i < 64; ++i)
    -
    2809  z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16)(sixteen ? stbi__get16be(z->s) : stbi__get8(z->s));
    -
    2810  L -= (sixteen ? 129 : 65);
    -
    2811  }
    -
    2812  return L==0;
    -
    2813 
    -
    2814  case 0xC4: // DHT - define huffman table
    -
    2815  L = stbi__get16be(z->s)-2;
    -
    2816  while (L > 0) {
    -
    2817  stbi_uc *v;
    -
    2818  int sizes[16],i,n=0;
    -
    2819  int q = stbi__get8(z->s);
    -
    2820  int tc = q >> 4;
    -
    2821  int th = q & 15;
    -
    2822  if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
    -
    2823  for (i=0; i < 16; ++i) {
    -
    2824  sizes[i] = stbi__get8(z->s);
    -
    2825  n += sizes[i];
    -
    2826  }
    -
    2827  L -= 17;
    -
    2828  if (tc == 0) {
    -
    2829  if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
    -
    2830  v = z->huff_dc[th].values;
    -
    2831  } else {
    -
    2832  if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;
    -
    2833  v = z->huff_ac[th].values;
    -
    2834  }
    -
    2835  for (i=0; i < n; ++i)
    -
    2836  v[i] = stbi__get8(z->s);
    -
    2837  if (tc != 0)
    -
    2838  stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
    -
    2839  L -= n;
    -
    2840  }
    -
    2841  return L==0;
    -
    2842  }
    -
    2843 
    -
    2844  // check for comment block or APP blocks
    -
    2845  if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
    -
    2846  L = stbi__get16be(z->s);
    -
    2847  if (L < 2) {
    -
    2848  if (m == 0xFE)
    -
    2849  return stbi__err("bad COM len","Corrupt JPEG");
    -
    2850  else
    -
    2851  return stbi__err("bad APP len","Corrupt JPEG");
    -
    2852  }
    -
    2853  L -= 2;
    -
    2854 
    -
    2855  if (m == 0xE0 && L >= 5) { // JFIF APP0 segment
    -
    2856  static const unsigned char tag[5] = {'J','F','I','F','\0'};
    -
    2857  int ok = 1;
    -
    2858  int i;
    -
    2859  for (i=0; i < 5; ++i)
    -
    2860  if (stbi__get8(z->s) != tag[i])
    -
    2861  ok = 0;
    -
    2862  L -= 5;
    -
    2863  if (ok)
    -
    2864  z->jfif = 1;
    -
    2865  } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment
    -
    2866  static const unsigned char tag[6] = {'A','d','o','b','e','\0'};
    -
    2867  int ok = 1;
    -
    2868  int i;
    -
    2869  for (i=0; i < 6; ++i)
    -
    2870  if (stbi__get8(z->s) != tag[i])
    -
    2871  ok = 0;
    -
    2872  L -= 6;
    -
    2873  if (ok) {
    -
    2874  stbi__get8(z->s); // version
    -
    2875  stbi__get16be(z->s); // flags0
    -
    2876  stbi__get16be(z->s); // flags1
    -
    2877  z->app14_color_transform = stbi__get8(z->s); // color transform
    -
    2878  L -= 6;
    -
    2879  }
    -
    2880  }
    -
    2881 
    -
    2882  stbi__skip(z->s, L);
    -
    2883  return 1;
    -
    2884  }
    -
    2885 
    -
    2886  return stbi__err("unknown marker","Corrupt JPEG");
    -
    2887 }
    +
    2799  // 16bit 8x8 transpose
    +
    2800  {
    +
    2801 // these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.
    +
    2802 // whether compilers actually get this is another story, sadly.
    +
    2803 #define dct_trn16(x, y) \
    +
    2804  { \
    +
    2805  int16x8x2_t t = vtrnq_s16(x, y); \
    +
    2806  x = t.val[0]; \
    +
    2807  y = t.val[1]; \
    +
    2808  }
    +
    2809 #define dct_trn32(x, y) \
    +
    2810  { \
    +
    2811  int32x4x2_t t = \
    +
    2812  vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); \
    +
    2813  x = vreinterpretq_s16_s32(t.val[0]); \
    +
    2814  y = vreinterpretq_s16_s32(t.val[1]); \
    +
    2815  }
    +
    2816 #define dct_trn64(x, y) \
    +
    2817  { \
    +
    2818  int16x8_t x0 = x; \
    +
    2819  int16x8_t y0 = y; \
    +
    2820  x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); \
    +
    2821  y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); \
    +
    2822  }
    +
    2823 
    +
    2824  // pass 1
    +
    2825  dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6
    +
    2826  dct_trn16(row2, row3);
    +
    2827  dct_trn16(row4, row5);
    +
    2828  dct_trn16(row6, row7);
    +
    2829 
    +
    2830  // pass 2
    +
    2831  dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4
    +
    2832  dct_trn32(row1, row3);
    +
    2833  dct_trn32(row4, row6);
    +
    2834  dct_trn32(row5, row7);
    +
    2835 
    +
    2836  // pass 3
    +
    2837  dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0
    +
    2838  dct_trn64(row1, row5);
    +
    2839  dct_trn64(row2, row6);
    +
    2840  dct_trn64(row3, row7);
    +
    2841 
    +
    2842 #undef dct_trn16
    +
    2843 #undef dct_trn32
    +
    2844 #undef dct_trn64
    +
    2845  }
    +
    2846 
    +
    2847  // row pass
    +
    2848  // vrshrn_n_s32 only supports shifts up to 16, we need
    +
    2849  // 17. so do a non-rounding shift of 16 first then follow
    +
    2850  // up with a rounding shift by 1.
    +
    2851  dct_pass(vshrn_n_s32, 16);
    +
    2852 
    +
    2853  {
    +
    2854  // pack and round
    +
    2855  uint8x8_t p0 = vqrshrun_n_s16(row0, 1);
    +
    2856  uint8x8_t p1 = vqrshrun_n_s16(row1, 1);
    +
    2857  uint8x8_t p2 = vqrshrun_n_s16(row2, 1);
    +
    2858  uint8x8_t p3 = vqrshrun_n_s16(row3, 1);
    +
    2859  uint8x8_t p4 = vqrshrun_n_s16(row4, 1);
    +
    2860  uint8x8_t p5 = vqrshrun_n_s16(row5, 1);
    +
    2861  uint8x8_t p6 = vqrshrun_n_s16(row6, 1);
    +
    2862  uint8x8_t p7 = vqrshrun_n_s16(row7, 1);
    +
    2863 
    +
    2864  // again, these can translate into one instruction, but often don't.
    +
    2865 #define dct_trn8_8(x, y) \
    +
    2866  { \
    +
    2867  uint8x8x2_t t = vtrn_u8(x, y); \
    +
    2868  x = t.val[0]; \
    +
    2869  y = t.val[1]; \
    +
    2870  }
    +
    2871 #define dct_trn8_16(x, y) \
    +
    2872  { \
    +
    2873  uint16x4x2_t t = \
    +
    2874  vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); \
    +
    2875  x = vreinterpret_u8_u16(t.val[0]); \
    +
    2876  y = vreinterpret_u8_u16(t.val[1]); \
    +
    2877  }
    +
    2878 #define dct_trn8_32(x, y) \
    +
    2879  { \
    +
    2880  uint32x2x2_t t = \
    +
    2881  vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); \
    +
    2882  x = vreinterpret_u8_u32(t.val[0]); \
    +
    2883  y = vreinterpret_u8_u32(t.val[1]); \
    +
    2884  }
    +
    2885 
    +
    2886  // sadly can't use interleaved stores here since we only write
    +
    2887  // 8 bytes to each scan line!
    2888 
    -
    2889 // after we see SOS
    -
    2890 static int stbi__process_scan_header(stbi__jpeg *z)
    -
    2891 {
    -
    2892  int i;
    -
    2893  int Ls = stbi__get16be(z->s);
    -
    2894  z->scan_n = stbi__get8(z->s);
    -
    2895  if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
    -
    2896  if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
    -
    2897  for (i=0; i < z->scan_n; ++i) {
    -
    2898  int id = stbi__get8(z->s), which;
    -
    2899  int q = stbi__get8(z->s);
    -
    2900  for (which = 0; which < z->s->img_n; ++which)
    -
    2901  if (z->img_comp[which].id == id)
    -
    2902  break;
    -
    2903  if (which == z->s->img_n) return 0; // no match
    -
    2904  z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
    -
    2905  z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
    -
    2906  z->order[i] = which;
    -
    2907  }
    -
    2908 
    -
    2909  {
    -
    2910  int aa;
    -
    2911  z->spec_start = stbi__get8(z->s);
    -
    2912  z->spec_end = stbi__get8(z->s); // should be 63, but might be 0
    -
    2913  aa = stbi__get8(z->s);
    -
    2914  z->succ_high = (aa >> 4);
    -
    2915  z->succ_low = (aa & 15);
    -
    2916  if (z->progressive) {
    -
    2917  if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)
    -
    2918  return stbi__err("bad SOS", "Corrupt JPEG");
    -
    2919  } else {
    -
    2920  if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
    -
    2921  if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
    -
    2922  z->spec_end = 63;
    -
    2923  }
    -
    2924  }
    -
    2925 
    -
    2926  return 1;
    -
    2927 }
    +
    2889  // 8x8 8-bit transpose pass 1
    +
    2890  dct_trn8_8(p0, p1);
    +
    2891  dct_trn8_8(p2, p3);
    +
    2892  dct_trn8_8(p4, p5);
    +
    2893  dct_trn8_8(p6, p7);
    +
    2894 
    +
    2895  // pass 2
    +
    2896  dct_trn8_16(p0, p2);
    +
    2897  dct_trn8_16(p1, p3);
    +
    2898  dct_trn8_16(p4, p6);
    +
    2899  dct_trn8_16(p5, p7);
    +
    2900 
    +
    2901  // pass 3
    +
    2902  dct_trn8_32(p0, p4);
    +
    2903  dct_trn8_32(p1, p5);
    +
    2904  dct_trn8_32(p2, p6);
    +
    2905  dct_trn8_32(p3, p7);
    +
    2906 
    +
    2907  // store
    +
    2908  vst1_u8(out, p0);
    +
    2909  out += out_stride;
    +
    2910  vst1_u8(out, p1);
    +
    2911  out += out_stride;
    +
    2912  vst1_u8(out, p2);
    +
    2913  out += out_stride;
    +
    2914  vst1_u8(out, p3);
    +
    2915  out += out_stride;
    +
    2916  vst1_u8(out, p4);
    +
    2917  out += out_stride;
    +
    2918  vst1_u8(out, p5);
    +
    2919  out += out_stride;
    +
    2920  vst1_u8(out, p6);
    +
    2921  out += out_stride;
    +
    2922  vst1_u8(out, p7);
    +
    2923 
    +
    2924 #undef dct_trn8_8
    +
    2925 #undef dct_trn8_16
    +
    2926 #undef dct_trn8_32
    +
    2927  }
    2928 
    -
    2929 static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)
    -
    2930 {
    -
    2931  int i;
    -
    2932  for (i=0; i < ncomp; ++i) {
    -
    2933  if (z->img_comp[i].raw_data) {
    -
    2934  STBI_FREE(z->img_comp[i].raw_data);
    -
    2935  z->img_comp[i].raw_data = NULL;
    -
    2936  z->img_comp[i].data = NULL;
    -
    2937  }
    -
    2938  if (z->img_comp[i].raw_coeff) {
    -
    2939  STBI_FREE(z->img_comp[i].raw_coeff);
    -
    2940  z->img_comp[i].raw_coeff = 0;
    -
    2941  z->img_comp[i].coeff = 0;
    -
    2942  }
    -
    2943  if (z->img_comp[i].linebuf) {
    -
    2944  STBI_FREE(z->img_comp[i].linebuf);
    -
    2945  z->img_comp[i].linebuf = NULL;
    -
    2946  }
    -
    2947  }
    -
    2948  return why;
    -
    2949 }
    -
    2950 
    -
    2951 static int stbi__process_frame_header(stbi__jpeg *z, int scan)
    -
    2952 {
    -
    2953  stbi__context *s = z->s;
    -
    2954  int Lf,p,i,q, h_max=1,v_max=1,c;
    -
    2955  Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
    -
    2956  p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
    -
    2957  s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
    -
    2958  s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
    -
    2959  c = stbi__get8(s);
    -
    2960  if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG");
    -
    2961  s->img_n = c;
    -
    2962  for (i=0; i < c; ++i) {
    -
    2963  z->img_comp[i].data = NULL;
    -
    2964  z->img_comp[i].linebuf = NULL;
    -
    2965  }
    -
    2966 
    -
    2967  if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
    -
    2968 
    -
    2969  z->rgb = 0;
    -
    2970  for (i=0; i < s->img_n; ++i) {
    -
    2971  static unsigned char rgb[3] = { 'R', 'G', 'B' };
    -
    2972  z->img_comp[i].id = stbi__get8(s);
    -
    2973  if (s->img_n == 3 && z->img_comp[i].id == rgb[i])
    -
    2974  ++z->rgb;
    -
    2975  q = stbi__get8(s);
    -
    2976  z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
    -
    2977  z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
    -
    2978  z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
    -
    2979  }
    -
    2980 
    -
    2981  if (scan != STBI__SCAN_load) return 1;
    -
    2982 
    -
    2983  if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode");
    -
    2984 
    -
    2985  for (i=0; i < s->img_n; ++i) {
    -
    2986  if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
    -
    2987  if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
    -
    2988  }
    -
    2989 
    -
    2990  // compute interleaved mcu info
    -
    2991  z->img_h_max = h_max;
    -
    2992  z->img_v_max = v_max;
    -
    2993  z->img_mcu_w = h_max * 8;
    -
    2994  z->img_mcu_h = v_max * 8;
    -
    2995  // these sizes can't be more than 17 bits
    -
    2996  z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
    -
    2997  z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
    -
    2998 
    -
    2999  for (i=0; i < s->img_n; ++i) {
    -
    3000  // number of effective pixels (e.g. for non-interleaved MCU)
    -
    3001  z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
    -
    3002  z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
    -
    3003  // to simplify generation, we'll allocate enough memory to decode
    -
    3004  // the bogus oversized data from using interleaved MCUs and their
    -
    3005  // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
    -
    3006  // discard the extra data until colorspace conversion
    -
    3007  //
    -
    3008  // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier)
    -
    3009  // so these muls can't overflow with 32-bit ints (which we require)
    -
    3010  z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
    -
    3011  z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
    -
    3012  z->img_comp[i].coeff = 0;
    -
    3013  z->img_comp[i].raw_coeff = 0;
    -
    3014  z->img_comp[i].linebuf = NULL;
    -
    3015  z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);
    -
    3016  if (z->img_comp[i].raw_data == NULL)
    -
    3017  return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
    -
    3018  // align blocks for idct using mmx/sse
    -
    3019  z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
    -
    3020  if (z->progressive) {
    -
    3021  // w2, h2 are multiples of 8 (see above)
    -
    3022  z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;
    -
    3023  z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;
    -
    3024  z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);
    -
    3025  if (z->img_comp[i].raw_coeff == NULL)
    -
    3026  return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
    -
    3027  z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
    -
    3028  }
    -
    3029  }
    -
    3030 
    -
    3031  return 1;
    -
    3032 }
    -
    3033 
    -
    3034 // use comparisons since in some cases we handle more than one case (e.g. SOF)
    -
    3035 #define stbi__DNL(x) ((x) == 0xdc)
    -
    3036 #define stbi__SOI(x) ((x) == 0xd8)
    -
    3037 #define stbi__EOI(x) ((x) == 0xd9)
    -
    3038 #define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
    -
    3039 #define stbi__SOS(x) ((x) == 0xda)
    -
    3040 
    -
    3041 #define stbi__SOF_progressive(x) ((x) == 0xc2)
    -
    3042 
    -
    3043 static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
    -
    3044 {
    -
    3045  int m;
    -
    3046  z->jfif = 0;
    -
    3047  z->app14_color_transform = -1; // valid values are 0,1,2
    -
    3048  z->marker = STBI__MARKER_none; // initialize cached marker to empty
    -
    3049  m = stbi__get_marker(z);
    -
    3050  if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
    -
    3051  if (scan == STBI__SCAN_type) return 1;
    -
    3052  m = stbi__get_marker(z);
    -
    3053  while (!stbi__SOF(m)) {
    -
    3054  if (!stbi__process_marker(z,m)) return 0;
    -
    3055  m = stbi__get_marker(z);
    -
    3056  while (m == STBI__MARKER_none) {
    -
    3057  // some files have extra padding after their blocks, so ok, we'll scan
    -
    3058  if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
    -
    3059  m = stbi__get_marker(z);
    -
    3060  }
    -
    3061  }
    -
    3062  z->progressive = stbi__SOF_progressive(m);
    -
    3063  if (!stbi__process_frame_header(z, scan)) return 0;
    -
    3064  return 1;
    -
    3065 }
    -
    3066 
    -
    3067 // decode image to YCbCr format
    -
    3068 static int stbi__decode_jpeg_image(stbi__jpeg *j)
    -
    3069 {
    -
    3070  int m;
    -
    3071  for (m = 0; m < 4; m++) {
    -
    3072  j->img_comp[m].raw_data = NULL;
    -
    3073  j->img_comp[m].raw_coeff = NULL;
    -
    3074  }
    -
    3075  j->restart_interval = 0;
    -
    3076  if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
    -
    3077  m = stbi__get_marker(j);
    -
    3078  while (!stbi__EOI(m)) {
    -
    3079  if (stbi__SOS(m)) {
    -
    3080  if (!stbi__process_scan_header(j)) return 0;
    -
    3081  if (!stbi__parse_entropy_coded_data(j)) return 0;
    -
    3082  if (j->marker == STBI__MARKER_none ) {
    -
    3083  // handle 0s at the end of image data from IP Kamera 9060
    -
    3084  while (!stbi__at_eof(j->s)) {
    -
    3085  int x = stbi__get8(j->s);
    -
    3086  if (x == 255) {
    -
    3087  j->marker = stbi__get8(j->s);
    -
    3088  break;
    -
    3089  }
    -
    3090  }
    -
    3091  // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
    -
    3092  }
    -
    3093  } else if (stbi__DNL(m)) {
    -
    3094  int Ld = stbi__get16be(j->s);
    -
    3095  stbi__uint32 NL = stbi__get16be(j->s);
    -
    3096  if (Ld != 4) stbi__err("bad DNL len", "Corrupt JPEG");
    -
    3097  if (NL != j->s->img_y) stbi__err("bad DNL height", "Corrupt JPEG");
    -
    3098  } else {
    -
    3099  if (!stbi__process_marker(j, m)) return 0;
    -
    3100  }
    -
    3101  m = stbi__get_marker(j);
    -
    3102  }
    -
    3103  if (j->progressive)
    -
    3104  stbi__jpeg_finish(j);
    -
    3105  return 1;
    -
    3106 }
    -
    3107 
    -
    3108 // static jfif-centered resampling (across block boundaries)
    -
    3109 
    -
    3110 typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,
    -
    3111  int w, int hs);
    -
    3112 
    -
    3113 #define stbi__div4(x) ((stbi_uc) ((x) >> 2))
    -
    3114 
    -
    3115 static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3116 {
    -
    3117  STBI_NOTUSED(out);
    -
    3118  STBI_NOTUSED(in_far);
    -
    3119  STBI_NOTUSED(w);
    -
    3120  STBI_NOTUSED(hs);
    -
    3121  return in_near;
    -
    3122 }
    -
    3123 
    -
    3124 static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3125 {
    -
    3126  // need to generate two samples vertically for every one in input
    -
    3127  int i;
    -
    3128  STBI_NOTUSED(hs);
    -
    3129  for (i=0; i < w; ++i)
    -
    3130  out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);
    -
    3131  return out;
    -
    3132 }
    -
    3133 
    -
    3134 static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3135 {
    -
    3136  // need to generate two samples horizontally for every one in input
    -
    3137  int i;
    -
    3138  stbi_uc *input = in_near;
    -
    3139 
    -
    3140  if (w == 1) {
    -
    3141  // if only one sample, can't do any interpolation
    -
    3142  out[0] = out[1] = input[0];
    -
    3143  return out;
    -
    3144  }
    -
    3145 
    -
    3146  out[0] = input[0];
    -
    3147  out[1] = stbi__div4(input[0]*3 + input[1] + 2);
    -
    3148  for (i=1; i < w-1; ++i) {
    -
    3149  int n = 3*input[i]+2;
    -
    3150  out[i*2+0] = stbi__div4(n+input[i-1]);
    -
    3151  out[i*2+1] = stbi__div4(n+input[i+1]);
    -
    3152  }
    -
    3153  out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);
    -
    3154  out[i*2+1] = input[w-1];
    -
    3155 
    -
    3156  STBI_NOTUSED(in_far);
    -
    3157  STBI_NOTUSED(hs);
    -
    3158 
    -
    3159  return out;
    -
    3160 }
    -
    3161 
    -
    3162 #define stbi__div16(x) ((stbi_uc) ((x) >> 4))
    -
    3163 
    -
    3164 static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3165 {
    -
    3166  // need to generate 2x2 samples for every one in input
    -
    3167  int i,t0,t1;
    -
    3168  if (w == 1) {
    -
    3169  out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
    -
    3170  return out;
    -
    3171  }
    -
    3172 
    -
    3173  t1 = 3*in_near[0] + in_far[0];
    -
    3174  out[0] = stbi__div4(t1+2);
    -
    3175  for (i=1; i < w; ++i) {
    -
    3176  t0 = t1;
    -
    3177  t1 = 3*in_near[i]+in_far[i];
    -
    3178  out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
    -
    3179  out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
    -
    3180  }
    -
    3181  out[w*2-1] = stbi__div4(t1+2);
    -
    3182 
    -
    3183  STBI_NOTUSED(hs);
    -
    3184 
    -
    3185  return out;
    -
    3186 }
    -
    3187 
    -
    3188 #if defined(STBI_SSE2) || defined(STBI_NEON)
    -
    3189 static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3190 {
    -
    3191  // need to generate 2x2 samples for every one in input
    -
    3192  int i=0,t0,t1;
    -
    3193 
    -
    3194  if (w == 1) {
    -
    3195  out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
    -
    3196  return out;
    -
    3197  }
    -
    3198 
    -
    3199  t1 = 3*in_near[0] + in_far[0];
    -
    3200  // process groups of 8 pixels for as long as we can.
    -
    3201  // note we can't handle the last pixel in a row in this loop
    -
    3202  // because we need to handle the filter boundary conditions.
    -
    3203  for (; i < ((w-1) & ~7); i += 8) {
    -
    3204 #if defined(STBI_SSE2)
    -
    3205  // load and perform the vertical filtering pass
    -
    3206  // this uses 3*x + y = 4*x + (y - x)
    -
    3207  __m128i zero = _mm_setzero_si128();
    -
    3208  __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i));
    -
    3209  __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));
    -
    3210  __m128i farw = _mm_unpacklo_epi8(farb, zero);
    -
    3211  __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
    -
    3212  __m128i diff = _mm_sub_epi16(farw, nearw);
    -
    3213  __m128i nears = _mm_slli_epi16(nearw, 2);
    -
    3214  __m128i curr = _mm_add_epi16(nears, diff); // current row
    -
    3215 
    -
    3216  // horizontal filter works the same based on shifted vers of current
    -
    3217  // row. "prev" is current row shifted right by 1 pixel; we need to
    -
    3218  // insert the previous pixel value (from t1).
    -
    3219  // "next" is current row shifted left by 1 pixel, with first pixel
    -
    3220  // of next block of 8 pixels added in.
    -
    3221  __m128i prv0 = _mm_slli_si128(curr, 2);
    -
    3222  __m128i nxt0 = _mm_srli_si128(curr, 2);
    -
    3223  __m128i prev = _mm_insert_epi16(prv0, t1, 0);
    -
    3224  __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);
    -
    3225 
    -
    3226  // horizontal filter, polyphase implementation since it's convenient:
    -
    3227  // even pixels = 3*cur + prev = cur*4 + (prev - cur)
    -
    3228  // odd pixels = 3*cur + next = cur*4 + (next - cur)
    -
    3229  // note the shared term.
    -
    3230  __m128i bias = _mm_set1_epi16(8);
    -
    3231  __m128i curs = _mm_slli_epi16(curr, 2);
    -
    3232  __m128i prvd = _mm_sub_epi16(prev, curr);
    -
    3233  __m128i nxtd = _mm_sub_epi16(next, curr);
    -
    3234  __m128i curb = _mm_add_epi16(curs, bias);
    -
    3235  __m128i even = _mm_add_epi16(prvd, curb);
    -
    3236  __m128i odd = _mm_add_epi16(nxtd, curb);
    -
    3237 
    -
    3238  // interleave even and odd pixels, then undo scaling.
    -
    3239  __m128i int0 = _mm_unpacklo_epi16(even, odd);
    -
    3240  __m128i int1 = _mm_unpackhi_epi16(even, odd);
    -
    3241  __m128i de0 = _mm_srli_epi16(int0, 4);
    -
    3242  __m128i de1 = _mm_srli_epi16(int1, 4);
    -
    3243 
    -
    3244  // pack and write output
    -
    3245  __m128i outv = _mm_packus_epi16(de0, de1);
    -
    3246  _mm_storeu_si128((__m128i *) (out + i*2), outv);
    -
    3247 #elif defined(STBI_NEON)
    -
    3248  // load and perform the vertical filtering pass
    -
    3249  // this uses 3*x + y = 4*x + (y - x)
    -
    3250  uint8x8_t farb = vld1_u8(in_far + i);
    -
    3251  uint8x8_t nearb = vld1_u8(in_near + i);
    -
    3252  int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
    -
    3253  int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
    -
    3254  int16x8_t curr = vaddq_s16(nears, diff); // current row
    -
    3255 
    -
    3256  // horizontal filter works the same based on shifted vers of current
    -
    3257  // row. "prev" is current row shifted right by 1 pixel; we need to
    -
    3258  // insert the previous pixel value (from t1).
    -
    3259  // "next" is current row shifted left by 1 pixel, with first pixel
    -
    3260  // of next block of 8 pixels added in.
    -
    3261  int16x8_t prv0 = vextq_s16(curr, curr, 7);
    -
    3262  int16x8_t nxt0 = vextq_s16(curr, curr, 1);
    -
    3263  int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
    -
    3264  int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);
    -
    3265 
    -
    3266  // horizontal filter, polyphase implementation since it's convenient:
    -
    3267  // even pixels = 3*cur + prev = cur*4 + (prev - cur)
    -
    3268  // odd pixels = 3*cur + next = cur*4 + (next - cur)
    -
    3269  // note the shared term.
    -
    3270  int16x8_t curs = vshlq_n_s16(curr, 2);
    -
    3271  int16x8_t prvd = vsubq_s16(prev, curr);
    -
    3272  int16x8_t nxtd = vsubq_s16(next, curr);
    -
    3273  int16x8_t even = vaddq_s16(curs, prvd);
    -
    3274  int16x8_t odd = vaddq_s16(curs, nxtd);
    +
    2929 #undef dct_long_mul
    +
    2930 #undef dct_long_mac
    +
    2931 #undef dct_widen
    +
    2932 #undef dct_wadd
    +
    2933 #undef dct_wsub
    +
    2934 #undef dct_bfly32o
    +
    2935 #undef dct_pass
    +
    2936 }
    +
    2937 
    +
    2938 #endif // STBI_NEON
    +
    2939 
    +
    2940 #define STBI__MARKER_none 0xff
    +
    2941 // if there's a pending marker from the entropy stream, return that
    +
    2942 // otherwise, fetch from the stream and get a marker. if there's no
    +
    2943 // marker, return 0xff, which is never a valid marker value
    +
    2944 static stbi_uc stbi__get_marker(stbi__jpeg *j)
    +
    2945 {
    +
    2946  stbi_uc x;
    +
    2947  if (j->marker != STBI__MARKER_none) {
    +
    2948  x = j->marker;
    +
    2949  j->marker = STBI__MARKER_none;
    +
    2950  return x;
    +
    2951  }
    +
    2952  x = stbi__get8(j->s);
    +
    2953  if (x != 0xff)
    +
    2954  return STBI__MARKER_none;
    +
    2955  while (x == 0xff)
    +
    2956  x = stbi__get8(j->s); // consume repeated 0xff fill bytes
    +
    2957  return x;
    +
    2958 }
    +
    2959 
    +
    2960 // in each scan, we'll have scan_n components, and the order
    +
    2961 // of the components is specified by order[]
    +
    2962 #define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
    +
    2963 
    +
    2964 // after a restart interval, stbi__jpeg_reset the entropy decoder and
    +
    2965 // the dc prediction
    +
    2966 static void stbi__jpeg_reset(stbi__jpeg *j)
    +
    2967 {
    +
    2968  j->code_bits = 0;
    +
    2969  j->code_buffer = 0;
    +
    2970  j->nomore = 0;
    +
    2971  j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred =
    +
    2972  j->img_comp[3].dc_pred = 0;
    +
    2973  j->marker = STBI__MARKER_none;
    +
    2974  j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
    +
    2975  j->eob_run = 0;
    +
    2976  // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
    +
    2977  // since we don't even allow 1<<30 pixels
    +
    2978 }
    +
    2979 
    +
    2980 static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
    +
    2981 {
    +
    2982  stbi__jpeg_reset(z);
    +
    2983  if (!z->progressive) {
    +
    2984  if (z->scan_n == 1) {
    +
    2985  int i, j;
    +
    2986  STBI_SIMD_ALIGN(short, data[64]);
    +
    2987  int n = z->order[0];
    +
    2988  // non-interleaved data, we just need to process one block at a
    +
    2989  // time, in trivial scanline order number of blocks to do just
    +
    2990  // depends on how many actual "pixels" this component has,
    +
    2991  // independent of interleaved MCU blocking and such
    +
    2992  int w = (z->img_comp[n].x + 7) >> 3;
    +
    2993  int h = (z->img_comp[n].y + 7) >> 3;
    +
    2994  for (j = 0; j < h; ++j) {
    +
    2995  for (i = 0; i < w; ++i) {
    +
    2996  int ha = z->img_comp[n].ha;
    +
    2997  if (!stbi__jpeg_decode_block(
    +
    2998  z, data, z->huff_dc + z->img_comp[n].hd,
    +
    2999  z->huff_ac + ha, z->fast_ac[ha], n,
    +
    3000  z->dequant[z->img_comp[n].tq]))
    +
    3001  return 0;
    +
    3002  z->idct_block_kernel(z->img_comp[n].data +
    +
    3003  z->img_comp[n].w2 * j * 8 + i * 8,
    +
    3004  z->img_comp[n].w2, data);
    +
    3005  // every data block is an MCU, so countdown the restart
    +
    3006  // interval
    +
    3007  if (--z->todo <= 0) {
    +
    3008  if (z->code_bits < 24)
    +
    3009  stbi__grow_buffer_unsafe(z);
    +
    3010  // if it's NOT a restart, then just bail, so we get
    +
    3011  // corrupt data rather than no data
    +
    3012  if (!STBI__RESTART(z->marker))
    +
    3013  return 1;
    +
    3014  stbi__jpeg_reset(z);
    +
    3015  }
    +
    3016  }
    +
    3017  }
    +
    3018  return 1;
    +
    3019  } else { // interleaved
    +
    3020  int i, j, k, x, y;
    +
    3021  STBI_SIMD_ALIGN(short, data[64]);
    +
    3022  for (j = 0; j < z->img_mcu_y; ++j) {
    +
    3023  for (i = 0; i < z->img_mcu_x; ++i) {
    +
    3024  // scan an interleaved mcu... process scan_n components in
    +
    3025  // order
    +
    3026  for (k = 0; k < z->scan_n; ++k) {
    +
    3027  int n = z->order[k];
    +
    3028  // scan out an mcu's worth of this component; that's
    +
    3029  // just determined by the basic H and V specified for
    +
    3030  // the component
    +
    3031  for (y = 0; y < z->img_comp[n].v; ++y) {
    +
    3032  for (x = 0; x < z->img_comp[n].h; ++x) {
    +
    3033  int x2 = (i * z->img_comp[n].h + x) * 8;
    +
    3034  int y2 = (j * z->img_comp[n].v + y) * 8;
    +
    3035  int ha = z->img_comp[n].ha;
    +
    3036  if (!stbi__jpeg_decode_block(
    +
    3037  z, data, z->huff_dc + z->img_comp[n].hd,
    +
    3038  z->huff_ac + ha, z->fast_ac[ha], n,
    +
    3039  z->dequant[z->img_comp[n].tq]))
    +
    3040  return 0;
    +
    3041  z->idct_block_kernel(
    +
    3042  z->img_comp[n].data +
    +
    3043  z->img_comp[n].w2 * y2 + x2,
    +
    3044  z->img_comp[n].w2, data);
    +
    3045  }
    +
    3046  }
    +
    3047  }
    +
    3048  // after all interleaved components, that's an interleaved
    +
    3049  // MCU, so now count down the restart interval
    +
    3050  if (--z->todo <= 0) {
    +
    3051  if (z->code_bits < 24)
    +
    3052  stbi__grow_buffer_unsafe(z);
    +
    3053  if (!STBI__RESTART(z->marker))
    +
    3054  return 1;
    +
    3055  stbi__jpeg_reset(z);
    +
    3056  }
    +
    3057  }
    +
    3058  }
    +
    3059  return 1;
    +
    3060  }
    +
    3061  } else {
    +
    3062  if (z->scan_n == 1) {
    +
    3063  int i, j;
    +
    3064  int n = z->order[0];
    +
    3065  // non-interleaved data, we just need to process one block at a
    +
    3066  // time, in trivial scanline order number of blocks to do just
    +
    3067  // depends on how many actual "pixels" this component has,
    +
    3068  // independent of interleaved MCU blocking and such
    +
    3069  int w = (z->img_comp[n].x + 7) >> 3;
    +
    3070  int h = (z->img_comp[n].y + 7) >> 3;
    +
    3071  for (j = 0; j < h; ++j) {
    +
    3072  for (i = 0; i < w; ++i) {
    +
    3073  short *data = z->img_comp[n].coeff +
    +
    3074  64 * (i + j * z->img_comp[n].coeff_w);
    +
    3075  if (z->spec_start == 0) {
    +
    3076  if (!stbi__jpeg_decode_block_prog_dc(
    +
    3077  z, data, &z->huff_dc[z->img_comp[n].hd], n))
    +
    3078  return 0;
    +
    3079  } else {
    +
    3080  int ha = z->img_comp[n].ha;
    +
    3081  if (!stbi__jpeg_decode_block_prog_ac(
    +
    3082  z, data, &z->huff_ac[ha], z->fast_ac[ha]))
    +
    3083  return 0;
    +
    3084  }
    +
    3085  // every data block is an MCU, so countdown the restart
    +
    3086  // interval
    +
    3087  if (--z->todo <= 0) {
    +
    3088  if (z->code_bits < 24)
    +
    3089  stbi__grow_buffer_unsafe(z);
    +
    3090  if (!STBI__RESTART(z->marker))
    +
    3091  return 1;
    +
    3092  stbi__jpeg_reset(z);
    +
    3093  }
    +
    3094  }
    +
    3095  }
    +
    3096  return 1;
    +
    3097  } else { // interleaved
    +
    3098  int i, j, k, x, y;
    +
    3099  for (j = 0; j < z->img_mcu_y; ++j) {
    +
    3100  for (i = 0; i < z->img_mcu_x; ++i) {
    +
    3101  // scan an interleaved mcu... process scan_n components in
    +
    3102  // order
    +
    3103  for (k = 0; k < z->scan_n; ++k) {
    +
    3104  int n = z->order[k];
    +
    3105  // scan out an mcu's worth of this component; that's
    +
    3106  // just determined by the basic H and V specified for
    +
    3107  // the component
    +
    3108  for (y = 0; y < z->img_comp[n].v; ++y) {
    +
    3109  for (x = 0; x < z->img_comp[n].h; ++x) {
    +
    3110  int x2 = (i * z->img_comp[n].h + x);
    +
    3111  int y2 = (j * z->img_comp[n].v + y);
    +
    3112  short *data =
    +
    3113  z->img_comp[n].coeff +
    +
    3114  64 * (x2 + y2 * z->img_comp[n].coeff_w);
    +
    3115  if (!stbi__jpeg_decode_block_prog_dc(
    +
    3116  z, data, &z->huff_dc[z->img_comp[n].hd],
    +
    3117  n))
    +
    3118  return 0;
    +
    3119  }
    +
    3120  }
    +
    3121  }
    +
    3122  // after all interleaved components, that's an interleaved
    +
    3123  // MCU, so now count down the restart interval
    +
    3124  if (--z->todo <= 0) {
    +
    3125  if (z->code_bits < 24)
    +
    3126  stbi__grow_buffer_unsafe(z);
    +
    3127  if (!STBI__RESTART(z->marker))
    +
    3128  return 1;
    +
    3129  stbi__jpeg_reset(z);
    +
    3130  }
    +
    3131  }
    +
    3132  }
    +
    3133  return 1;
    +
    3134  }
    +
    3135  }
    +
    3136 }
    +
    3137 
    +
    3138 static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant)
    +
    3139 {
    +
    3140  int i;
    +
    3141  for (i = 0; i < 64; ++i)
    +
    3142  data[i] *= dequant[i];
    +
    3143 }
    +
    3144 
    +
    3145 static void stbi__jpeg_finish(stbi__jpeg *z)
    +
    3146 {
    +
    3147  if (z->progressive) {
    +
    3148  // dequantize and idct the data
    +
    3149  int i, j, n;
    +
    3150  for (n = 0; n < z->s->img_n; ++n) {
    +
    3151  int w = (z->img_comp[n].x + 7) >> 3;
    +
    3152  int h = (z->img_comp[n].y + 7) >> 3;
    +
    3153  for (j = 0; j < h; ++j) {
    +
    3154  for (i = 0; i < w; ++i) {
    +
    3155  short *data = z->img_comp[n].coeff +
    +
    3156  64 * (i + j * z->img_comp[n].coeff_w);
    +
    3157  stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
    +
    3158  z->idct_block_kernel(z->img_comp[n].data +
    +
    3159  z->img_comp[n].w2 * j * 8 + i * 8,
    +
    3160  z->img_comp[n].w2, data);
    +
    3161  }
    +
    3162  }
    +
    3163  }
    +
    3164  }
    +
    3165 }
    +
    3166 
    +
    3167 static int stbi__process_marker(stbi__jpeg *z, int m)
    +
    3168 {
    +
    3169  int L;
    +
    3170  switch (m) {
    +
    3171  case STBI__MARKER_none: // no marker found
    +
    3172  return stbi__err("expected marker", "Corrupt JPEG");
    +
    3173 
    +
    3174  case 0xDD: // DRI - specify restart interval
    +
    3175  if (stbi__get16be(z->s) != 4)
    +
    3176  return stbi__err("bad DRI len", "Corrupt JPEG");
    +
    3177  z->restart_interval = stbi__get16be(z->s);
    +
    3178  return 1;
    +
    3179 
    +
    3180  case 0xDB: // DQT - define quantization table
    +
    3181  L = stbi__get16be(z->s) - 2;
    +
    3182  while (L > 0) {
    +
    3183  int q = stbi__get8(z->s);
    +
    3184  int p = q >> 4, sixteen = (p != 0);
    +
    3185  int t = q & 15, i;
    +
    3186  if (p != 0 && p != 1)
    +
    3187  return stbi__err("bad DQT type", "Corrupt JPEG");
    +
    3188  if (t > 3)
    +
    3189  return stbi__err("bad DQT table", "Corrupt JPEG");
    +
    3190 
    +
    3191  for (i = 0; i < 64; ++i)
    +
    3192  z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16)(
    +
    3193  sixteen ? stbi__get16be(z->s) : stbi__get8(z->s));
    +
    3194  L -= (sixteen ? 129 : 65);
    +
    3195  }
    +
    3196  return L == 0;
    +
    3197 
    +
    3198  case 0xC4: // DHT - define huffman table
    +
    3199  L = stbi__get16be(z->s) - 2;
    +
    3200  while (L > 0) {
    +
    3201  stbi_uc *v;
    +
    3202  int sizes[16], i, n = 0;
    +
    3203  int q = stbi__get8(z->s);
    +
    3204  int tc = q >> 4;
    +
    3205  int th = q & 15;
    +
    3206  if (tc > 1 || th > 3)
    +
    3207  return stbi__err("bad DHT header", "Corrupt JPEG");
    +
    3208  for (i = 0; i < 16; ++i) {
    +
    3209  sizes[i] = stbi__get8(z->s);
    +
    3210  n += sizes[i];
    +
    3211  }
    +
    3212  L -= 17;
    +
    3213  if (tc == 0) {
    +
    3214  if (!stbi__build_huffman(z->huff_dc + th, sizes))
    +
    3215  return 0;
    +
    3216  v = z->huff_dc[th].values;
    +
    3217  } else {
    +
    3218  if (!stbi__build_huffman(z->huff_ac + th, sizes))
    +
    3219  return 0;
    +
    3220  v = z->huff_ac[th].values;
    +
    3221  }
    +
    3222  for (i = 0; i < n; ++i)
    +
    3223  v[i] = stbi__get8(z->s);
    +
    3224  if (tc != 0)
    +
    3225  stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
    +
    3226  L -= n;
    +
    3227  }
    +
    3228  return L == 0;
    +
    3229  }
    +
    3230 
    +
    3231  // check for comment block or APP blocks
    +
    3232  if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
    +
    3233  L = stbi__get16be(z->s);
    +
    3234  if (L < 2) {
    +
    3235  if (m == 0xFE)
    +
    3236  return stbi__err("bad COM len", "Corrupt JPEG");
    +
    3237  else
    +
    3238  return stbi__err("bad APP len", "Corrupt JPEG");
    +
    3239  }
    +
    3240  L -= 2;
    +
    3241 
    +
    3242  if (m == 0xE0 && L >= 5) { // JFIF APP0 segment
    +
    3243  static const unsigned char tag[5] = {'J', 'F', 'I', 'F', '\0'};
    +
    3244  int ok = 1;
    +
    3245  int i;
    +
    3246  for (i = 0; i < 5; ++i)
    +
    3247  if (stbi__get8(z->s) != tag[i])
    +
    3248  ok = 0;
    +
    3249  L -= 5;
    +
    3250  if (ok)
    +
    3251  z->jfif = 1;
    +
    3252  } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment
    +
    3253  static const unsigned char tag[6] = {'A', 'd', 'o', 'b', 'e', '\0'};
    +
    3254  int ok = 1;
    +
    3255  int i;
    +
    3256  for (i = 0; i < 6; ++i)
    +
    3257  if (stbi__get8(z->s) != tag[i])
    +
    3258  ok = 0;
    +
    3259  L -= 6;
    +
    3260  if (ok) {
    +
    3261  stbi__get8(z->s); // version
    +
    3262  stbi__get16be(z->s); // flags0
    +
    3263  stbi__get16be(z->s); // flags1
    +
    3264  z->app14_color_transform = stbi__get8(z->s); // color transform
    +
    3265  L -= 6;
    +
    3266  }
    +
    3267  }
    +
    3268 
    +
    3269  stbi__skip(z->s, L);
    +
    3270  return 1;
    +
    3271  }
    +
    3272 
    +
    3273  return stbi__err("unknown marker", "Corrupt JPEG");
    +
    3274 }
    3275 
    -
    3276  // undo scaling and round, then store with even/odd phases interleaved
    -
    3277  uint8x8x2_t o;
    -
    3278  o.val[0] = vqrshrun_n_s16(even, 4);
    -
    3279  o.val[1] = vqrshrun_n_s16(odd, 4);
    -
    3280  vst2_u8(out + i*2, o);
    -
    3281 #endif
    -
    3282 
    -
    3283  // "previous" value for next iter
    -
    3284  t1 = 3*in_near[i+7] + in_far[i+7];
    -
    3285  }
    -
    3286 
    -
    3287  t0 = t1;
    -
    3288  t1 = 3*in_near[i] + in_far[i];
    -
    3289  out[i*2] = stbi__div16(3*t1 + t0 + 8);
    -
    3290 
    -
    3291  for (++i; i < w; ++i) {
    -
    3292  t0 = t1;
    -
    3293  t1 = 3*in_near[i]+in_far[i];
    -
    3294  out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
    -
    3295  out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
    -
    3296  }
    -
    3297  out[w*2-1] = stbi__div4(t1+2);
    -
    3298 
    -
    3299  STBI_NOTUSED(hs);
    -
    3300 
    -
    3301  return out;
    -
    3302 }
    -
    3303 #endif
    -
    3304 
    -
    3305 static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
    -
    3306 {
    -
    3307  // resample with nearest-neighbor
    -
    3308  int i,j;
    -
    3309  STBI_NOTUSED(in_far);
    -
    3310  for (i=0; i < w; ++i)
    -
    3311  for (j=0; j < hs; ++j)
    -
    3312  out[i*hs+j] = in_near[i];
    -
    3313  return out;
    -
    3314 }
    -
    3315 
    -
    3316 // this is a reduced-precision calculation of YCbCr-to-RGB introduced
    -
    3317 // to make sure the code produces the same results in both SIMD and scalar
    -
    3318 #define stbi__float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8)
    -
    3319 static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
    -
    3320 {
    -
    3321  int i;
    -
    3322  for (i=0; i < count; ++i) {
    -
    3323  int y_fixed = (y[i] << 20) + (1<<19); // rounding
    -
    3324  int r,g,b;
    -
    3325  int cr = pcr[i] - 128;
    -
    3326  int cb = pcb[i] - 128;
    -
    3327  r = y_fixed + cr* stbi__float2fixed(1.40200f);
    -
    3328  g = y_fixed + (cr*-stbi__float2fixed(0.71414f)) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
    -
    3329  b = y_fixed + cb* stbi__float2fixed(1.77200f);
    -
    3330  r >>= 20;
    -
    3331  g >>= 20;
    -
    3332  b >>= 20;
    -
    3333  if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
    -
    3334  if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
    -
    3335  if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
    -
    3336  out[0] = (stbi_uc)r;
    -
    3337  out[1] = (stbi_uc)g;
    -
    3338  out[2] = (stbi_uc)b;
    -
    3339  out[3] = 255;
    -
    3340  out += step;
    -
    3341  }
    -
    3342 }
    -
    3343 
    -
    3344 #if defined(STBI_SSE2) || defined(STBI_NEON)
    -
    3345 static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)
    -
    3346 {
    -
    3347  int i = 0;
    +
    3276 // after we see SOS
    +
    3277 static int stbi__process_scan_header(stbi__jpeg *z)
    +
    3278 {
    +
    3279  int i;
    +
    3280  int Ls = stbi__get16be(z->s);
    +
    3281  z->scan_n = stbi__get8(z->s);
    +
    3282  if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int)z->s->img_n)
    +
    3283  return stbi__err("bad SOS component count", "Corrupt JPEG");
    +
    3284  if (Ls != 6 + 2 * z->scan_n)
    +
    3285  return stbi__err("bad SOS len", "Corrupt JPEG");
    +
    3286  for (i = 0; i < z->scan_n; ++i) {
    +
    3287  int id = stbi__get8(z->s), which;
    +
    3288  int q = stbi__get8(z->s);
    +
    3289  for (which = 0; which < z->s->img_n; ++which)
    +
    3290  if (z->img_comp[which].id == id)
    +
    3291  break;
    +
    3292  if (which == z->s->img_n)
    +
    3293  return 0; // no match
    +
    3294  z->img_comp[which].hd = q >> 4;
    +
    3295  if (z->img_comp[which].hd > 3)
    +
    3296  return stbi__err("bad DC huff", "Corrupt JPEG");
    +
    3297  z->img_comp[which].ha = q & 15;
    +
    3298  if (z->img_comp[which].ha > 3)
    +
    3299  return stbi__err("bad AC huff", "Corrupt JPEG");
    +
    3300  z->order[i] = which;
    +
    3301  }
    +
    3302 
    +
    3303  {
    +
    3304  int aa;
    +
    3305  z->spec_start = stbi__get8(z->s);
    +
    3306  z->spec_end = stbi__get8(z->s); // should be 63, but might be 0
    +
    3307  aa = stbi__get8(z->s);
    +
    3308  z->succ_high = (aa >> 4);
    +
    3309  z->succ_low = (aa & 15);
    +
    3310  if (z->progressive) {
    +
    3311  if (z->spec_start > 63 || z->spec_end > 63 ||
    +
    3312  z->spec_start > z->spec_end || z->succ_high > 13 ||
    +
    3313  z->succ_low > 13)
    +
    3314  return stbi__err("bad SOS", "Corrupt JPEG");
    +
    3315  } else {
    +
    3316  if (z->spec_start != 0)
    +
    3317  return stbi__err("bad SOS", "Corrupt JPEG");
    +
    3318  if (z->succ_high != 0 || z->succ_low != 0)
    +
    3319  return stbi__err("bad SOS", "Corrupt JPEG");
    +
    3320  z->spec_end = 63;
    +
    3321  }
    +
    3322  }
    +
    3323 
    +
    3324  return 1;
    +
    3325 }
    +
    3326 
    +
    3327 static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)
    +
    3328 {
    +
    3329  int i;
    +
    3330  for (i = 0; i < ncomp; ++i) {
    +
    3331  if (z->img_comp[i].raw_data) {
    +
    3332  STBI_FREE(z->img_comp[i].raw_data);
    +
    3333  z->img_comp[i].raw_data = NULL;
    +
    3334  z->img_comp[i].data = NULL;
    +
    3335  }
    +
    3336  if (z->img_comp[i].raw_coeff) {
    +
    3337  STBI_FREE(z->img_comp[i].raw_coeff);
    +
    3338  z->img_comp[i].raw_coeff = 0;
    +
    3339  z->img_comp[i].coeff = 0;
    +
    3340  }
    +
    3341  if (z->img_comp[i].linebuf) {
    +
    3342  STBI_FREE(z->img_comp[i].linebuf);
    +
    3343  z->img_comp[i].linebuf = NULL;
    +
    3344  }
    +
    3345  }
    +
    3346  return why;
    +
    3347 }
    3348 
    -
    3349 #ifdef STBI_SSE2
    -
    3350  // step == 3 is pretty ugly on the final interleave, and i'm not convinced
    -
    3351  // it's useful in practice (you wouldn't use it for textures, for example).
    -
    3352  // so just accelerate step == 4 case.
    -
    3353  if (step == 4) {
    -
    3354  // this is a fairly straightforward implementation and not super-optimized.
    -
    3355  __m128i signflip = _mm_set1_epi8(-0x80);
    -
    3356  __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f));
    -
    3357  __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));
    -
    3358  __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));
    -
    3359  __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f));
    -
    3360  __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);
    -
    3361  __m128i xw = _mm_set1_epi16(255); // alpha channel
    -
    3362 
    -
    3363  for (; i+7 < count; i += 8) {
    -
    3364  // load
    -
    3365  __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));
    -
    3366  __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));
    -
    3367  __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));
    -
    3368  __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
    -
    3369  __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
    -
    3370 
    -
    3371  // unpack to short (and left-shift cr, cb by 8)
    -
    3372  __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);
    -
    3373  __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
    -
    3374  __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
    -
    3375 
    -
    3376  // color transform
    -
    3377  __m128i yws = _mm_srli_epi16(yw, 4);
    -
    3378  __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
    -
    3379  __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
    -
    3380  __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
    -
    3381  __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
    -
    3382  __m128i rws = _mm_add_epi16(cr0, yws);
    -
    3383  __m128i gwt = _mm_add_epi16(cb0, yws);
    -
    3384  __m128i bws = _mm_add_epi16(yws, cb1);
    -
    3385  __m128i gws = _mm_add_epi16(gwt, cr1);
    -
    3386 
    -
    3387  // descale
    -
    3388  __m128i rw = _mm_srai_epi16(rws, 4);
    -
    3389  __m128i bw = _mm_srai_epi16(bws, 4);
    -
    3390  __m128i gw = _mm_srai_epi16(gws, 4);
    -
    3391 
    -
    3392  // back to byte, set up for transpose
    -
    3393  __m128i brb = _mm_packus_epi16(rw, bw);
    -
    3394  __m128i gxb = _mm_packus_epi16(gw, xw);
    -
    3395 
    -
    3396  // transpose to interleave channels
    -
    3397  __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
    -
    3398  __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
    -
    3399  __m128i o0 = _mm_unpacklo_epi16(t0, t1);
    -
    3400  __m128i o1 = _mm_unpackhi_epi16(t0, t1);
    -
    3401 
    -
    3402  // store
    -
    3403  _mm_storeu_si128((__m128i *) (out + 0), o0);
    -
    3404  _mm_storeu_si128((__m128i *) (out + 16), o1);
    -
    3405  out += 32;
    -
    3406  }
    -
    3407  }
    -
    3408 #endif
    -
    3409 
    -
    3410 #ifdef STBI_NEON
    -
    3411  // in this version, step=3 support would be easy to add. but is there demand?
    -
    3412  if (step == 4) {
    -
    3413  // this is a fairly straightforward implementation and not super-optimized.
    -
    3414  uint8x8_t signflip = vdup_n_u8(0x80);
    -
    3415  int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f));
    -
    3416  int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));
    -
    3417  int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));
    -
    3418  int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f));
    -
    3419 
    -
    3420  for (; i+7 < count; i += 8) {
    -
    3421  // load
    -
    3422  uint8x8_t y_bytes = vld1_u8(y + i);
    -
    3423  uint8x8_t cr_bytes = vld1_u8(pcr + i);
    -
    3424  uint8x8_t cb_bytes = vld1_u8(pcb + i);
    -
    3425  int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
    -
    3426  int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
    -
    3427 
    -
    3428  // expand to s16
    -
    3429  int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
    -
    3430  int16x8_t crw = vshll_n_s8(cr_biased, 7);
    -
    3431  int16x8_t cbw = vshll_n_s8(cb_biased, 7);
    -
    3432 
    -
    3433  // color transform
    -
    3434  int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
    -
    3435  int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
    -
    3436  int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
    -
    3437  int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
    -
    3438  int16x8_t rws = vaddq_s16(yws, cr0);
    -
    3439  int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
    -
    3440  int16x8_t bws = vaddq_s16(yws, cb1);
    -
    3441 
    -
    3442  // undo scaling, round, convert to byte
    -
    3443  uint8x8x4_t o;
    -
    3444  o.val[0] = vqrshrun_n_s16(rws, 4);
    -
    3445  o.val[1] = vqrshrun_n_s16(gws, 4);
    -
    3446  o.val[2] = vqrshrun_n_s16(bws, 4);
    -
    3447  o.val[3] = vdup_n_u8(255);
    -
    3448 
    -
    3449  // store, interleaving r/g/b/a
    -
    3450  vst4_u8(out, o);
    -
    3451  out += 8*4;
    -
    3452  }
    -
    3453  }
    -
    3454 #endif
    -
    3455 
    -
    3456  for (; i < count; ++i) {
    -
    3457  int y_fixed = (y[i] << 20) + (1<<19); // rounding
    -
    3458  int r,g,b;
    -
    3459  int cr = pcr[i] - 128;
    -
    3460  int cb = pcb[i] - 128;
    -
    3461  r = y_fixed + cr* stbi__float2fixed(1.40200f);
    -
    3462  g = y_fixed + cr*-stbi__float2fixed(0.71414f) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
    -
    3463  b = y_fixed + cb* stbi__float2fixed(1.77200f);
    -
    3464  r >>= 20;
    -
    3465  g >>= 20;
    -
    3466  b >>= 20;
    -
    3467  if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
    -
    3468  if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
    -
    3469  if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
    -
    3470  out[0] = (stbi_uc)r;
    -
    3471  out[1] = (stbi_uc)g;
    -
    3472  out[2] = (stbi_uc)b;
    -
    3473  out[3] = 255;
    -
    3474  out += step;
    -
    3475  }
    -
    3476 }
    -
    3477 #endif
    -
    3478 
    -
    3479 // set up the kernels
    -
    3480 static void stbi__setup_jpeg(stbi__jpeg *j)
    -
    3481 {
    -
    3482  j->idct_block_kernel = stbi__idct_block;
    -
    3483  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
    -
    3484  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
    -
    3485 
    -
    3486 #ifdef STBI_SSE2
    -
    3487  if (stbi__sse2_available()) {
    -
    3488  j->idct_block_kernel = stbi__idct_simd;
    -
    3489  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
    -
    3490  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
    -
    3491  }
    -
    3492 #endif
    -
    3493 
    -
    3494 #ifdef STBI_NEON
    -
    3495  j->idct_block_kernel = stbi__idct_simd;
    -
    3496  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
    -
    3497  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
    -
    3498 #endif
    -
    3499 }
    -
    3500 
    -
    3501 // clean up the temporary component buffers
    -
    3502 static void stbi__cleanup_jpeg(stbi__jpeg *j)
    -
    3503 {
    -
    3504  stbi__free_jpeg_components(j, j->s->img_n, 0);
    -
    3505 }
    -
    3506 
    -
    3507 typedef struct
    -
    3508 {
    -
    3509  resample_row_func resample;
    -
    3510  stbi_uc *line0,*line1;
    -
    3511  int hs,vs; // expansion factor in each axis
    -
    3512  int w_lores; // horizontal pixels pre-expansion
    -
    3513  int ystep; // how far through vertical expansion we are
    -
    3514  int ypos; // which pre-expansion row we're on
    -
    3515 } stbi__resample;
    -
    3516 
    -
    3517 // fast 0..255 * 0..255 => 0..255 rounded multiplication
    -
    3518 static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
    -
    3519 {
    -
    3520  unsigned int t = x*y + 128;
    -
    3521  return (stbi_uc) ((t + (t >>8)) >> 8);
    -
    3522 }
    -
    3523 
    -
    3524 static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
    -
    3525 {
    -
    3526  int n, decode_n, is_rgb;
    -
    3527  z->s->img_n = 0; // make stbi__cleanup_jpeg safe
    -
    3528 
    -
    3529  // validate req_comp
    -
    3530  if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
    -
    3531 
    -
    3532  // load a jpeg image from whichever source, but leave in YCbCr format
    -
    3533  if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
    -
    3534 
    -
    3535  // determine actual number of components to generate
    -
    3536  n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1;
    -
    3537 
    -
    3538  is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif));
    -
    3539 
    -
    3540  if (z->s->img_n == 3 && n < 3 && !is_rgb)
    -
    3541  decode_n = 1;
    -
    3542  else
    -
    3543  decode_n = z->s->img_n;
    -
    3544 
    -
    3545  // resample and color-convert
    -
    3546  {
    -
    3547  int k;
    -
    3548  unsigned int i,j;
    -
    3549  stbi_uc *output;
    -
    3550  stbi_uc *coutput[4];
    +
    3349 static int stbi__process_frame_header(stbi__jpeg *z, int scan)
    +
    3350 {
    +
    3351  stbi__context *s = z->s;
    +
    3352  int Lf, p, i, q, h_max = 1, v_max = 1, c;
    +
    3353  Lf = stbi__get16be(s);
    +
    3354  if (Lf < 11)
    +
    3355  return stbi__err("bad SOF len", "Corrupt JPEG"); // JPEG
    +
    3356  p = stbi__get8(s);
    +
    3357  if (p != 8)
    +
    3358  return stbi__err(
    +
    3359  "only 8-bit",
    +
    3360  "JPEG format not supported: 8-bit only"); // JPEG baseline
    +
    3361  s->img_y = stbi__get16be(s);
    +
    3362  if (s->img_y == 0)
    +
    3363  return stbi__err(
    +
    3364  "no header height",
    +
    3365  "JPEG format not supported: delayed height"); // Legal, but we don't
    +
    3366  // handle it--but
    +
    3367  // neither does IJG
    +
    3368  s->img_x = stbi__get16be(s);
    +
    3369  if (s->img_x == 0)
    +
    3370  return stbi__err("0 width", "Corrupt JPEG"); // JPEG requires
    +
    3371  c = stbi__get8(s);
    +
    3372  if (c != 3 && c != 1 && c != 4)
    +
    3373  return stbi__err("bad component count", "Corrupt JPEG");
    +
    3374  s->img_n = c;
    +
    3375  for (i = 0; i < c; ++i) {
    +
    3376  z->img_comp[i].data = NULL;
    +
    3377  z->img_comp[i].linebuf = NULL;
    +
    3378  }
    +
    3379 
    +
    3380  if (Lf != 8 + 3 * s->img_n)
    +
    3381  return stbi__err("bad SOF len", "Corrupt JPEG");
    +
    3382 
    +
    3383  z->rgb = 0;
    +
    3384  for (i = 0; i < s->img_n; ++i) {
    +
    3385  static unsigned char rgb[3] = {'R', 'G', 'B'};
    +
    3386  z->img_comp[i].id = stbi__get8(s);
    +
    3387  if (s->img_n == 3 && z->img_comp[i].id == rgb[i])
    +
    3388  ++z->rgb;
    +
    3389  q = stbi__get8(s);
    +
    3390  z->img_comp[i].h = (q >> 4);
    +
    3391  if (!z->img_comp[i].h || z->img_comp[i].h > 4)
    +
    3392  return stbi__err("bad H", "Corrupt JPEG");
    +
    3393  z->img_comp[i].v = q & 15;
    +
    3394  if (!z->img_comp[i].v || z->img_comp[i].v > 4)
    +
    3395  return stbi__err("bad V", "Corrupt JPEG");
    +
    3396  z->img_comp[i].tq = stbi__get8(s);
    +
    3397  if (z->img_comp[i].tq > 3)
    +
    3398  return stbi__err("bad TQ", "Corrupt JPEG");
    +
    3399  }
    +
    3400 
    +
    3401  if (scan != STBI__SCAN_load)
    +
    3402  return 1;
    +
    3403 
    +
    3404  if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0))
    +
    3405  return stbi__err("too large", "Image too large to decode");
    +
    3406 
    +
    3407  for (i = 0; i < s->img_n; ++i) {
    +
    3408  if (z->img_comp[i].h > h_max)
    +
    3409  h_max = z->img_comp[i].h;
    +
    3410  if (z->img_comp[i].v > v_max)
    +
    3411  v_max = z->img_comp[i].v;
    +
    3412  }
    +
    3413 
    +
    3414  // compute interleaved mcu info
    +
    3415  z->img_h_max = h_max;
    +
    3416  z->img_v_max = v_max;
    +
    3417  z->img_mcu_w = h_max * 8;
    +
    3418  z->img_mcu_h = v_max * 8;
    +
    3419  // these sizes can't be more than 17 bits
    +
    3420  z->img_mcu_x = (s->img_x + z->img_mcu_w - 1) / z->img_mcu_w;
    +
    3421  z->img_mcu_y = (s->img_y + z->img_mcu_h - 1) / z->img_mcu_h;
    +
    3422 
    +
    3423  for (i = 0; i < s->img_n; ++i) {
    +
    3424  // number of effective pixels (e.g. for non-interleaved MCU)
    +
    3425  z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max - 1) / h_max;
    +
    3426  z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max - 1) / v_max;
    +
    3427  // to simplify generation, we'll allocate enough memory to decode
    +
    3428  // the bogus oversized data from using interleaved MCUs and their
    +
    3429  // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
    +
    3430  // discard the extra data until colorspace conversion
    +
    3431  //
    +
    3432  // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked
    +
    3433  // earlier) so these muls can't overflow with 32-bit ints (which we
    +
    3434  // require)
    +
    3435  z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
    +
    3436  z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
    +
    3437  z->img_comp[i].coeff = 0;
    +
    3438  z->img_comp[i].raw_coeff = 0;
    +
    3439  z->img_comp[i].linebuf = NULL;
    +
    3440  z->img_comp[i].raw_data =
    +
    3441  stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);
    +
    3442  if (z->img_comp[i].raw_data == NULL)
    +
    3443  return stbi__free_jpeg_components(
    +
    3444  z, i + 1, stbi__err("outofmem", "Out of memory"));
    +
    3445  // align blocks for idct using mmx/sse
    +
    3446  z->img_comp[i].data =
    +
    3447  (stbi_uc *)(((size_t)z->img_comp[i].raw_data + 15) & ~15);
    +
    3448  if (z->progressive) {
    +
    3449  // w2, h2 are multiples of 8 (see above)
    +
    3450  z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;
    +
    3451  z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;
    +
    3452  z->img_comp[i].raw_coeff = stbi__malloc_mad3(
    +
    3453  z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);
    +
    3454  if (z->img_comp[i].raw_coeff == NULL)
    +
    3455  return stbi__free_jpeg_components(
    +
    3456  z, i + 1, stbi__err("outofmem", "Out of memory"));
    +
    3457  z->img_comp[i].coeff =
    +
    3458  (short *)(((size_t)z->img_comp[i].raw_coeff + 15) & ~15);
    +
    3459  }
    +
    3460  }
    +
    3461 
    +
    3462  return 1;
    +
    3463 }
    +
    3464 
    +
    3465 // use comparisons since in some cases we handle more than one case (e.g. SOF)
    +
    3466 #define stbi__DNL(x) ((x) == 0xdc)
    +
    3467 #define stbi__SOI(x) ((x) == 0xd8)
    +
    3468 #define stbi__EOI(x) ((x) == 0xd9)
    +
    3469 #define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
    +
    3470 #define stbi__SOS(x) ((x) == 0xda)
    +
    3471 
    +
    3472 #define stbi__SOF_progressive(x) ((x) == 0xc2)
    +
    3473 
    +
    3474 static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
    +
    3475 {
    +
    3476  int m;
    +
    3477  z->jfif = 0;
    +
    3478  z->app14_color_transform = -1; // valid values are 0,1,2
    +
    3479  z->marker = STBI__MARKER_none; // initialize cached marker to empty
    +
    3480  m = stbi__get_marker(z);
    +
    3481  if (!stbi__SOI(m))
    +
    3482  return stbi__err("no SOI", "Corrupt JPEG");
    +
    3483  if (scan == STBI__SCAN_type)
    +
    3484  return 1;
    +
    3485  m = stbi__get_marker(z);
    +
    3486  while (!stbi__SOF(m)) {
    +
    3487  if (!stbi__process_marker(z, m))
    +
    3488  return 0;
    +
    3489  m = stbi__get_marker(z);
    +
    3490  while (m == STBI__MARKER_none) {
    +
    3491  // some files have extra padding after their blocks, so ok, we'll
    +
    3492  // scan
    +
    3493  if (stbi__at_eof(z->s))
    +
    3494  return stbi__err("no SOF", "Corrupt JPEG");
    +
    3495  m = stbi__get_marker(z);
    +
    3496  }
    +
    3497  }
    +
    3498  z->progressive = stbi__SOF_progressive(m);
    +
    3499  if (!stbi__process_frame_header(z, scan))
    +
    3500  return 0;
    +
    3501  return 1;
    +
    3502 }
    +
    3503 
    +
    3504 // decode image to YCbCr format
    +
    3505 static int stbi__decode_jpeg_image(stbi__jpeg *j)
    +
    3506 {
    +
    3507  int m;
    +
    3508  for (m = 0; m < 4; m++) {
    +
    3509  j->img_comp[m].raw_data = NULL;
    +
    3510  j->img_comp[m].raw_coeff = NULL;
    +
    3511  }
    +
    3512  j->restart_interval = 0;
    +
    3513  if (!stbi__decode_jpeg_header(j, STBI__SCAN_load))
    +
    3514  return 0;
    +
    3515  m = stbi__get_marker(j);
    +
    3516  while (!stbi__EOI(m)) {
    +
    3517  if (stbi__SOS(m)) {
    +
    3518  if (!stbi__process_scan_header(j))
    +
    3519  return 0;
    +
    3520  if (!stbi__parse_entropy_coded_data(j))
    +
    3521  return 0;
    +
    3522  if (j->marker == STBI__MARKER_none) {
    +
    3523  // handle 0s at the end of image data from IP Kamera 9060
    +
    3524  while (!stbi__at_eof(j->s)) {
    +
    3525  int x = stbi__get8(j->s);
    +
    3526  if (x == 255) {
    +
    3527  j->marker = stbi__get8(j->s);
    +
    3528  break;
    +
    3529  }
    +
    3530  }
    +
    3531  // if we reach eof without hitting a marker, stbi__get_marker()
    +
    3532  // below will fail and we'll eventually return 0
    +
    3533  }
    +
    3534  } else if (stbi__DNL(m)) {
    +
    3535  int Ld = stbi__get16be(j->s);
    +
    3536  stbi__uint32 NL = stbi__get16be(j->s);
    +
    3537  if (Ld != 4)
    +
    3538  stbi__err("bad DNL len", "Corrupt JPEG");
    +
    3539  if (NL != j->s->img_y)
    +
    3540  stbi__err("bad DNL height", "Corrupt JPEG");
    +
    3541  } else {
    +
    3542  if (!stbi__process_marker(j, m))
    +
    3543  return 0;
    +
    3544  }
    +
    3545  m = stbi__get_marker(j);
    +
    3546  }
    +
    3547  if (j->progressive)
    +
    3548  stbi__jpeg_finish(j);
    +
    3549  return 1;
    +
    3550 }
    3551 
    -
    3552  stbi__resample res_comp[4];
    +
    3552 // static jfif-centered resampling (across block boundaries)
    3553 
    -
    3554  for (k=0; k < decode_n; ++k) {
    -
    3555  stbi__resample *r = &res_comp[k];
    +
    3554 typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,
    +
    3555  int w, int hs);
    3556 
    -
    3557  // allocate line buffer big enough for upsampling off the edges
    -
    3558  // with upsample factor of 4
    -
    3559  z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);
    -
    3560  if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
    -
    3561 
    -
    3562  r->hs = z->img_h_max / z->img_comp[k].h;
    -
    3563  r->vs = z->img_v_max / z->img_comp[k].v;
    -
    3564  r->ystep = r->vs >> 1;
    -
    3565  r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
    -
    3566  r->ypos = 0;
    -
    3567  r->line0 = r->line1 = z->img_comp[k].data;
    +
    3557 #define stbi__div4(x) ((stbi_uc)((x) >> 2))
    +
    3558 
    +
    3559 static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far,
    +
    3560  int w, int hs)
    +
    3561 {
    +
    3562  STBI_NOTUSED(out);
    +
    3563  STBI_NOTUSED(in_far);
    +
    3564  STBI_NOTUSED(w);
    +
    3565  STBI_NOTUSED(hs);
    +
    3566  return in_near;
    +
    3567 }
    3568 
    -
    3569  if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
    -
    3570  else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;
    -
    3571  else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;
    -
    3572  else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;
    -
    3573  else r->resample = stbi__resample_row_generic;
    -
    3574  }
    -
    3575 
    -
    3576  // can't error after this so, this is safe
    -
    3577  output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1);
    -
    3578  if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
    +
    3569 static stbi_uc *stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near,
    +
    3570  stbi_uc *in_far, int w, int hs)
    +
    3571 {
    +
    3572  // need to generate two samples vertically for every one in input
    +
    3573  int i;
    +
    3574  STBI_NOTUSED(hs);
    +
    3575  for (i = 0; i < w; ++i)
    +
    3576  out[i] = stbi__div4(3 * in_near[i] + in_far[i] + 2);
    +
    3577  return out;
    +
    3578 }
    3579 
    -
    3580  // now go ahead and resample
    -
    3581  for (j=0; j < z->s->img_y; ++j) {
    -
    3582  stbi_uc *out = output + n * z->s->img_x * j;
    -
    3583  for (k=0; k < decode_n; ++k) {
    -
    3584  stbi__resample *r = &res_comp[k];
    -
    3585  int y_bot = r->ystep >= (r->vs >> 1);
    -
    3586  coutput[k] = r->resample(z->img_comp[k].linebuf,
    -
    3587  y_bot ? r->line1 : r->line0,
    -
    3588  y_bot ? r->line0 : r->line1,
    -
    3589  r->w_lores, r->hs);
    -
    3590  if (++r->ystep >= r->vs) {
    -
    3591  r->ystep = 0;
    -
    3592  r->line0 = r->line1;
    -
    3593  if (++r->ypos < z->img_comp[k].y)
    -
    3594  r->line1 += z->img_comp[k].w2;
    -
    3595  }
    -
    3596  }
    -
    3597  if (n >= 3) {
    -
    3598  stbi_uc *y = coutput[0];
    -
    3599  if (z->s->img_n == 3) {
    -
    3600  if (is_rgb) {
    -
    3601  for (i=0; i < z->s->img_x; ++i) {
    -
    3602  out[0] = y[i];
    -
    3603  out[1] = coutput[1][i];
    -
    3604  out[2] = coutput[2][i];
    -
    3605  out[3] = 255;
    -
    3606  out += n;
    -
    3607  }
    -
    3608  } else {
    -
    3609  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
    -
    3610  }
    -
    3611  } else if (z->s->img_n == 4) {
    -
    3612  if (z->app14_color_transform == 0) { // CMYK
    -
    3613  for (i=0; i < z->s->img_x; ++i) {
    -
    3614  stbi_uc m = coutput[3][i];
    -
    3615  out[0] = stbi__blinn_8x8(coutput[0][i], m);
    -
    3616  out[1] = stbi__blinn_8x8(coutput[1][i], m);
    -
    3617  out[2] = stbi__blinn_8x8(coutput[2][i], m);
    -
    3618  out[3] = 255;
    -
    3619  out += n;
    -
    3620  }
    -
    3621  } else if (z->app14_color_transform == 2) { // YCCK
    -
    3622  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
    -
    3623  for (i=0; i < z->s->img_x; ++i) {
    -
    3624  stbi_uc m = coutput[3][i];
    -
    3625  out[0] = stbi__blinn_8x8(255 - out[0], m);
    -
    3626  out[1] = stbi__blinn_8x8(255 - out[1], m);
    -
    3627  out[2] = stbi__blinn_8x8(255 - out[2], m);
    -
    3628  out += n;
    -
    3629  }
    -
    3630  } else { // YCbCr + alpha? Ignore the fourth channel for now
    -
    3631  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
    -
    3632  }
    -
    3633  } else
    -
    3634  for (i=0; i < z->s->img_x; ++i) {
    -
    3635  out[0] = out[1] = out[2] = y[i];
    -
    3636  out[3] = 255; // not used if n==3
    -
    3637  out += n;
    -
    3638  }
    -
    3639  } else {
    -
    3640  if (is_rgb) {
    -
    3641  if (n == 1)
    -
    3642  for (i=0; i < z->s->img_x; ++i)
    -
    3643  *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
    -
    3644  else {
    -
    3645  for (i=0; i < z->s->img_x; ++i, out += 2) {
    -
    3646  out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
    -
    3647  out[1] = 255;
    -
    3648  }
    -
    3649  }
    -
    3650  } else if (z->s->img_n == 4 && z->app14_color_transform == 0) {
    -
    3651  for (i=0; i < z->s->img_x; ++i) {
    -
    3652  stbi_uc m = coutput[3][i];
    -
    3653  stbi_uc r = stbi__blinn_8x8(coutput[0][i], m);
    -
    3654  stbi_uc g = stbi__blinn_8x8(coutput[1][i], m);
    -
    3655  stbi_uc b = stbi__blinn_8x8(coutput[2][i], m);
    -
    3656  out[0] = stbi__compute_y(r, g, b);
    -
    3657  out[1] = 255;
    -
    3658  out += n;
    -
    3659  }
    -
    3660  } else if (z->s->img_n == 4 && z->app14_color_transform == 2) {
    -
    3661  for (i=0; i < z->s->img_x; ++i) {
    -
    3662  out[0] = stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]);
    -
    3663  out[1] = 255;
    -
    3664  out += n;
    -
    3665  }
    -
    3666  } else {
    -
    3667  stbi_uc *y = coutput[0];
    -
    3668  if (n == 1)
    -
    3669  for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
    -
    3670  else
    -
    3671  for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;
    -
    3672  }
    -
    3673  }
    -
    3674  }
    -
    3675  stbi__cleanup_jpeg(z);
    -
    3676  *out_x = z->s->img_x;
    -
    3677  *out_y = z->s->img_y;
    -
    3678  if (comp) *comp = z->s->img_n >= 3 ? 3 : 1; // report original components, not output
    -
    3679  return output;
    -
    3680  }
    -
    3681 }
    -
    3682 
    -
    3683 static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    3684 {
    -
    3685  unsigned char* result;
    -
    3686  stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg));
    -
    3687  STBI_NOTUSED(ri);
    -
    3688  j->s = s;
    -
    3689  stbi__setup_jpeg(j);
    -
    3690  result = load_jpeg_image(j, x,y,comp,req_comp);
    -
    3691  STBI_FREE(j);
    -
    3692  return result;
    -
    3693 }
    -
    3694 
    -
    3695 static int stbi__jpeg_test(stbi__context *s)
    -
    3696 {
    -
    3697  int r;
    -
    3698  stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg));
    -
    3699  j->s = s;
    -
    3700  stbi__setup_jpeg(j);
    -
    3701  r = stbi__decode_jpeg_header(j, STBI__SCAN_type);
    -
    3702  stbi__rewind(s);
    -
    3703  STBI_FREE(j);
    -
    3704  return r;
    -
    3705 }
    -
    3706 
    -
    3707 static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
    -
    3708 {
    -
    3709  if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {
    -
    3710  stbi__rewind( j->s );
    -
    3711  return 0;
    -
    3712  }
    -
    3713  if (x) *x = j->s->img_x;
    -
    3714  if (y) *y = j->s->img_y;
    -
    3715  if (comp) *comp = j->s->img_n >= 3 ? 3 : 1;
    -
    3716  return 1;
    -
    3717 }
    -
    3718 
    -
    3719 static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
    -
    3720 {
    -
    3721  int result;
    -
    3722  stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
    -
    3723  j->s = s;
    -
    3724  result = stbi__jpeg_info_raw(j, x, y, comp);
    -
    3725  STBI_FREE(j);
    -
    3726  return result;
    -
    3727 }
    -
    3728 #endif
    -
    3729 
    -
    3730 // public domain zlib decode v0.2 Sean Barrett 2006-11-18
    -
    3731 // simple implementation
    -
    3732 // - all input must be provided in an upfront buffer
    -
    3733 // - all output is written to a single output buffer (can malloc/realloc)
    -
    3734 // performance
    -
    3735 // - fast huffman
    -
    3736 
    -
    3737 #ifndef STBI_NO_ZLIB
    -
    3738 
    -
    3739 // fast-way is faster to check than jpeg huffman, but slow way is slower
    -
    3740 #define STBI__ZFAST_BITS 9 // accelerate all cases in default tables
    -
    3741 #define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)
    -
    3742 
    -
    3743 // zlib-style huffman encoding
    -
    3744 // (jpegs packs from left, zlib from right, so can't share code)
    -
    3745 typedef struct
    -
    3746 {
    -
    3747  stbi__uint16 fast[1 << STBI__ZFAST_BITS];
    -
    3748  stbi__uint16 firstcode[16];
    -
    3749  int maxcode[17];
    -
    3750  stbi__uint16 firstsymbol[16];
    -
    3751  stbi_uc size[288];
    -
    3752  stbi__uint16 value[288];
    -
    3753 } stbi__zhuffman;
    -
    3754 
    -
    3755 stbi_inline static int stbi__bitreverse16(int n)
    -
    3756 {
    -
    3757  n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
    -
    3758  n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
    -
    3759  n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
    -
    3760  n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
    -
    3761  return n;
    -
    3762 }
    -
    3763 
    -
    3764 stbi_inline static int stbi__bit_reverse(int v, int bits)
    -
    3765 {
    -
    3766  STBI_ASSERT(bits <= 16);
    -
    3767  // to bit reverse n bits, reverse 16 and shift
    -
    3768  // e.g. 11 bits, bit reverse and shift away 5
    -
    3769  return stbi__bitreverse16(v) >> (16-bits);
    -
    3770 }
    -
    3771 
    -
    3772 static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int num)
    -
    3773 {
    -
    3774  int i,k=0;
    -
    3775  int code, next_code[16], sizes[17];
    -
    3776 
    -
    3777  // DEFLATE spec for generating codes
    -
    3778  memset(sizes, 0, sizeof(sizes));
    -
    3779  memset(z->fast, 0, sizeof(z->fast));
    -
    3780  for (i=0; i < num; ++i)
    -
    3781  ++sizes[sizelist[i]];
    -
    3782  sizes[0] = 0;
    -
    3783  for (i=1; i < 16; ++i)
    -
    3784  if (sizes[i] > (1 << i))
    -
    3785  return stbi__err("bad sizes", "Corrupt PNG");
    -
    3786  code = 0;
    -
    3787  for (i=1; i < 16; ++i) {
    -
    3788  next_code[i] = code;
    -
    3789  z->firstcode[i] = (stbi__uint16) code;
    -
    3790  z->firstsymbol[i] = (stbi__uint16) k;
    -
    3791  code = (code + sizes[i]);
    -
    3792  if (sizes[i])
    -
    3793  if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
    -
    3794  z->maxcode[i] = code << (16-i); // preshift for inner loop
    -
    3795  code <<= 1;
    -
    3796  k += sizes[i];
    -
    3797  }
    -
    3798  z->maxcode[16] = 0x10000; // sentinel
    -
    3799  for (i=0; i < num; ++i) {
    -
    3800  int s = sizelist[i];
    -
    3801  if (s) {
    -
    3802  int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
    -
    3803  stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);
    -
    3804  z->size [c] = (stbi_uc ) s;
    -
    3805  z->value[c] = (stbi__uint16) i;
    -
    3806  if (s <= STBI__ZFAST_BITS) {
    -
    3807  int j = stbi__bit_reverse(next_code[s],s);
    -
    3808  while (j < (1 << STBI__ZFAST_BITS)) {
    -
    3809  z->fast[j] = fastv;
    -
    3810  j += (1 << s);
    -
    3811  }
    -
    3812  }
    -
    3813  ++next_code[s];
    -
    3814  }
    -
    3815  }
    -
    3816  return 1;
    -
    3817 }
    -
    3818 
    -
    3819 // zlib-from-memory implementation for PNG reading
    -
    3820 // because PNG allows splitting the zlib stream arbitrarily,
    -
    3821 // and it's annoying structurally to have PNG call ZLIB call PNG,
    -
    3822 // we require PNG read all the IDATs and combine them into a single
    -
    3823 // memory buffer
    -
    3824 
    -
    3825 typedef struct
    -
    3826 {
    -
    3827  stbi_uc *zbuffer, *zbuffer_end;
    -
    3828  int num_bits;
    -
    3829  stbi__uint32 code_buffer;
    -
    3830 
    -
    3831  char *zout;
    -
    3832  char *zout_start;
    -
    3833  char *zout_end;
    -
    3834  int z_expandable;
    +
    3580 static stbi_uc *stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near,
    +
    3581  stbi_uc *in_far, int w, int hs)
    +
    3582 {
    +
    3583  // need to generate two samples horizontally for every one in input
    +
    3584  int i;
    +
    3585  stbi_uc *input = in_near;
    +
    3586 
    +
    3587  if (w == 1) {
    +
    3588  // if only one sample, can't do any interpolation
    +
    3589  out[0] = out[1] = input[0];
    +
    3590  return out;
    +
    3591  }
    +
    3592 
    +
    3593  out[0] = input[0];
    +
    3594  out[1] = stbi__div4(input[0] * 3 + input[1] + 2);
    +
    3595  for (i = 1; i < w - 1; ++i) {
    +
    3596  int n = 3 * input[i] + 2;
    +
    3597  out[i * 2 + 0] = stbi__div4(n + input[i - 1]);
    +
    3598  out[i * 2 + 1] = stbi__div4(n + input[i + 1]);
    +
    3599  }
    +
    3600  out[i * 2 + 0] = stbi__div4(input[w - 2] * 3 + input[w - 1] + 2);
    +
    3601  out[i * 2 + 1] = input[w - 1];
    +
    3602 
    +
    3603  STBI_NOTUSED(in_far);
    +
    3604  STBI_NOTUSED(hs);
    +
    3605 
    +
    3606  return out;
    +
    3607 }
    +
    3608 
    +
    3609 #define stbi__div16(x) ((stbi_uc)((x) >> 4))
    +
    3610 
    +
    3611 static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near,
    +
    3612  stbi_uc *in_far, int w, int hs)
    +
    3613 {
    +
    3614  // need to generate 2x2 samples for every one in input
    +
    3615  int i, t0, t1;
    +
    3616  if (w == 1) {
    +
    3617  out[0] = out[1] = stbi__div4(3 * in_near[0] + in_far[0] + 2);
    +
    3618  return out;
    +
    3619  }
    +
    3620 
    +
    3621  t1 = 3 * in_near[0] + in_far[0];
    +
    3622  out[0] = stbi__div4(t1 + 2);
    +
    3623  for (i = 1; i < w; ++i) {
    +
    3624  t0 = t1;
    +
    3625  t1 = 3 * in_near[i] + in_far[i];
    +
    3626  out[i * 2 - 1] = stbi__div16(3 * t0 + t1 + 8);
    +
    3627  out[i * 2] = stbi__div16(3 * t1 + t0 + 8);
    +
    3628  }
    +
    3629  out[w * 2 - 1] = stbi__div4(t1 + 2);
    +
    3630 
    +
    3631  STBI_NOTUSED(hs);
    +
    3632 
    +
    3633  return out;
    +
    3634 }
    +
    3635 
    +
    3636 #if defined(STBI_SSE2) || defined(STBI_NEON)
    +
    3637 static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near,
    +
    3638  stbi_uc *in_far, int w, int hs)
    +
    3639 {
    +
    3640  // need to generate 2x2 samples for every one in input
    +
    3641  int i = 0, t0, t1;
    +
    3642 
    +
    3643  if (w == 1) {
    +
    3644  out[0] = out[1] = stbi__div4(3 * in_near[0] + in_far[0] + 2);
    +
    3645  return out;
    +
    3646  }
    +
    3647 
    +
    3648  t1 = 3 * in_near[0] + in_far[0];
    +
    3649  // process groups of 8 pixels for as long as we can.
    +
    3650  // note we can't handle the last pixel in a row in this loop
    +
    3651  // because we need to handle the filter boundary conditions.
    +
    3652  for (; i < ((w - 1) & ~7); i += 8) {
    +
    3653 #if defined(STBI_SSE2)
    +
    3654  // load and perform the vertical filtering pass
    +
    3655  // this uses 3*x + y = 4*x + (y - x)
    +
    3656  __m128i zero = _mm_setzero_si128();
    +
    3657  __m128i farb = _mm_loadl_epi64((__m128i *)(in_far + i));
    +
    3658  __m128i nearb = _mm_loadl_epi64((__m128i *)(in_near + i));
    +
    3659  __m128i farw = _mm_unpacklo_epi8(farb, zero);
    +
    3660  __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
    +
    3661  __m128i diff = _mm_sub_epi16(farw, nearw);
    +
    3662  __m128i nears = _mm_slli_epi16(nearw, 2);
    +
    3663  __m128i curr = _mm_add_epi16(nears, diff); // current row
    +
    3664 
    +
    3665  // horizontal filter works the same based on shifted vers of current
    +
    3666  // row. "prev" is current row shifted right by 1 pixel; we need to
    +
    3667  // insert the previous pixel value (from t1).
    +
    3668  // "next" is current row shifted left by 1 pixel, with first pixel
    +
    3669  // of next block of 8 pixels added in.
    +
    3670  __m128i prv0 = _mm_slli_si128(curr, 2);
    +
    3671  __m128i nxt0 = _mm_srli_si128(curr, 2);
    +
    3672  __m128i prev = _mm_insert_epi16(prv0, t1, 0);
    +
    3673  __m128i next =
    +
    3674  _mm_insert_epi16(nxt0, 3 * in_near[i + 8] + in_far[i + 8], 7);
    +
    3675 
    +
    3676  // horizontal filter, polyphase implementation since it's convenient:
    +
    3677  // even pixels = 3*cur + prev = cur*4 + (prev - cur)
    +
    3678  // odd pixels = 3*cur + next = cur*4 + (next - cur)
    +
    3679  // note the shared term.
    +
    3680  __m128i bias = _mm_set1_epi16(8);
    +
    3681  __m128i curs = _mm_slli_epi16(curr, 2);
    +
    3682  __m128i prvd = _mm_sub_epi16(prev, curr);
    +
    3683  __m128i nxtd = _mm_sub_epi16(next, curr);
    +
    3684  __m128i curb = _mm_add_epi16(curs, bias);
    +
    3685  __m128i even = _mm_add_epi16(prvd, curb);
    +
    3686  __m128i odd = _mm_add_epi16(nxtd, curb);
    +
    3687 
    +
    3688  // interleave even and odd pixels, then undo scaling.
    +
    3689  __m128i int0 = _mm_unpacklo_epi16(even, odd);
    +
    3690  __m128i int1 = _mm_unpackhi_epi16(even, odd);
    +
    3691  __m128i de0 = _mm_srli_epi16(int0, 4);
    +
    3692  __m128i de1 = _mm_srli_epi16(int1, 4);
    +
    3693 
    +
    3694  // pack and write output
    +
    3695  __m128i outv = _mm_packus_epi16(de0, de1);
    +
    3696  _mm_storeu_si128((__m128i *)(out + i * 2), outv);
    +
    3697 #elif defined(STBI_NEON)
    +
    3698  // load and perform the vertical filtering pass
    +
    3699  // this uses 3*x + y = 4*x + (y - x)
    +
    3700  uint8x8_t farb = vld1_u8(in_far + i);
    +
    3701  uint8x8_t nearb = vld1_u8(in_near + i);
    +
    3702  int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
    +
    3703  int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
    +
    3704  int16x8_t curr = vaddq_s16(nears, diff); // current row
    +
    3705 
    +
    3706  // horizontal filter works the same based on shifted vers of current
    +
    3707  // row. "prev" is current row shifted right by 1 pixel; we need to
    +
    3708  // insert the previous pixel value (from t1).
    +
    3709  // "next" is current row shifted left by 1 pixel, with first pixel
    +
    3710  // of next block of 8 pixels added in.
    +
    3711  int16x8_t prv0 = vextq_s16(curr, curr, 7);
    +
    3712  int16x8_t nxt0 = vextq_s16(curr, curr, 1);
    +
    3713  int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
    +
    3714  int16x8_t next =
    +
    3715  vsetq_lane_s16(3 * in_near[i + 8] + in_far[i + 8], nxt0, 7);
    +
    3716 
    +
    3717  // horizontal filter, polyphase implementation since it's convenient:
    +
    3718  // even pixels = 3*cur + prev = cur*4 + (prev - cur)
    +
    3719  // odd pixels = 3*cur + next = cur*4 + (next - cur)
    +
    3720  // note the shared term.
    +
    3721  int16x8_t curs = vshlq_n_s16(curr, 2);
    +
    3722  int16x8_t prvd = vsubq_s16(prev, curr);
    +
    3723  int16x8_t nxtd = vsubq_s16(next, curr);
    +
    3724  int16x8_t even = vaddq_s16(curs, prvd);
    +
    3725  int16x8_t odd = vaddq_s16(curs, nxtd);
    +
    3726 
    +
    3727  // undo scaling and round, then store with even/odd phases interleaved
    +
    3728  uint8x8x2_t o;
    +
    3729  o.val[0] = vqrshrun_n_s16(even, 4);
    +
    3730  o.val[1] = vqrshrun_n_s16(odd, 4);
    +
    3731  vst2_u8(out + i * 2, o);
    +
    3732 #endif
    +
    3733 
    +
    3734  // "previous" value for next iter
    +
    3735  t1 = 3 * in_near[i + 7] + in_far[i + 7];
    +
    3736  }
    +
    3737 
    +
    3738  t0 = t1;
    +
    3739  t1 = 3 * in_near[i] + in_far[i];
    +
    3740  out[i * 2] = stbi__div16(3 * t1 + t0 + 8);
    +
    3741 
    +
    3742  for (++i; i < w; ++i) {
    +
    3743  t0 = t1;
    +
    3744  t1 = 3 * in_near[i] + in_far[i];
    +
    3745  out[i * 2 - 1] = stbi__div16(3 * t0 + t1 + 8);
    +
    3746  out[i * 2] = stbi__div16(3 * t1 + t0 + 8);
    +
    3747  }
    +
    3748  out[w * 2 - 1] = stbi__div4(t1 + 2);
    +
    3749 
    +
    3750  STBI_NOTUSED(hs);
    +
    3751 
    +
    3752  return out;
    +
    3753 }
    +
    3754 #endif
    +
    3755 
    +
    3756 static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near,
    +
    3757  stbi_uc *in_far, int w, int hs)
    +
    3758 {
    +
    3759  // resample with nearest-neighbor
    +
    3760  int i, j;
    +
    3761  STBI_NOTUSED(in_far);
    +
    3762  for (i = 0; i < w; ++i)
    +
    3763  for (j = 0; j < hs; ++j)
    +
    3764  out[i * hs + j] = in_near[i];
    +
    3765  return out;
    +
    3766 }
    +
    3767 
    +
    3768 // this is a reduced-precision calculation of YCbCr-to-RGB introduced
    +
    3769 // to make sure the code produces the same results in both SIMD and scalar
    +
    3770 #define stbi__float2fixed(x) (((int)((x)*4096.0f + 0.5f)) << 8)
    +
    3771 static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y,
    +
    3772  const stbi_uc *pcb, const stbi_uc *pcr,
    +
    3773  int count, int step)
    +
    3774 {
    +
    3775  int i;
    +
    3776  for (i = 0; i < count; ++i) {
    +
    3777  int y_fixed = (y[i] << 20) + (1 << 19); // rounding
    +
    3778  int r, g, b;
    +
    3779  int cr = pcr[i] - 128;
    +
    3780  int cb = pcb[i] - 128;
    +
    3781  r = y_fixed + cr * stbi__float2fixed(1.40200f);
    +
    3782  g = y_fixed + (cr * -stbi__float2fixed(0.71414f)) +
    +
    3783  ((cb * -stbi__float2fixed(0.34414f)) & 0xffff0000);
    +
    3784  b = y_fixed + cb * stbi__float2fixed(1.77200f);
    +
    3785  r >>= 20;
    +
    3786  g >>= 20;
    +
    3787  b >>= 20;
    +
    3788  if ((unsigned)r > 255) {
    +
    3789  if (r < 0)
    +
    3790  r = 0;
    +
    3791  else
    +
    3792  r = 255;
    +
    3793  }
    +
    3794  if ((unsigned)g > 255) {
    +
    3795  if (g < 0)
    +
    3796  g = 0;
    +
    3797  else
    +
    3798  g = 255;
    +
    3799  }
    +
    3800  if ((unsigned)b > 255) {
    +
    3801  if (b < 0)
    +
    3802  b = 0;
    +
    3803  else
    +
    3804  b = 255;
    +
    3805  }
    +
    3806  out[0] = (stbi_uc)r;
    +
    3807  out[1] = (stbi_uc)g;
    +
    3808  out[2] = (stbi_uc)b;
    +
    3809  out[3] = 255;
    +
    3810  out += step;
    +
    3811  }
    +
    3812 }
    +
    3813 
    +
    3814 #if defined(STBI_SSE2) || defined(STBI_NEON)
    +
    3815 static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y,
    +
    3816  stbi_uc const *pcb, stbi_uc const *pcr,
    +
    3817  int count, int step)
    +
    3818 {
    +
    3819  int i = 0;
    +
    3820 
    +
    3821 #ifdef STBI_SSE2
    +
    3822  // step == 3 is pretty ugly on the final interleave, and i'm not convinced
    +
    3823  // it's useful in practice (you wouldn't use it for textures, for example).
    +
    3824  // so just accelerate step == 4 case.
    +
    3825  if (step == 4) {
    +
    3826  // this is a fairly straightforward implementation and not
    +
    3827  // super-optimized.
    +
    3828  __m128i signflip = _mm_set1_epi8(-0x80);
    +
    3829  __m128i cr_const0 = _mm_set1_epi16((short)(1.40200f * 4096.0f + 0.5f));
    +
    3830  __m128i cr_const1 = _mm_set1_epi16(-(short)(0.71414f * 4096.0f + 0.5f));
    +
    3831  __m128i cb_const0 = _mm_set1_epi16(-(short)(0.34414f * 4096.0f + 0.5f));
    +
    3832  __m128i cb_const1 = _mm_set1_epi16((short)(1.77200f * 4096.0f + 0.5f));
    +
    3833  __m128i y_bias = _mm_set1_epi8((char)(unsigned char)128);
    +
    3834  __m128i xw = _mm_set1_epi16(255); // alpha channel
    3835 
    -
    3836  stbi__zhuffman z_length, z_distance;
    -
    3837 } stbi__zbuf;
    -
    3838 
    -
    3839 stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
    -
    3840 {
    -
    3841  if (z->zbuffer >= z->zbuffer_end) return 0;
    -
    3842  return *z->zbuffer++;
    -
    3843 }
    -
    3844 
    -
    3845 static void stbi__fill_bits(stbi__zbuf *z)
    -
    3846 {
    -
    3847  do {
    -
    3848  STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
    -
    3849  z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits;
    -
    3850  z->num_bits += 8;
    -
    3851  } while (z->num_bits <= 24);
    -
    3852 }
    -
    3853 
    -
    3854 stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)
    -
    3855 {
    -
    3856  unsigned int k;
    -
    3857  if (z->num_bits < n) stbi__fill_bits(z);
    -
    3858  k = z->code_buffer & ((1 << n) - 1);
    -
    3859  z->code_buffer >>= n;
    -
    3860  z->num_bits -= n;
    -
    3861  return k;
    -
    3862 }
    -
    3863 
    -
    3864 static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
    -
    3865 {
    -
    3866  int b,s,k;
    -
    3867  // not resolved by fast table, so compute it the slow way
    -
    3868  // use jpeg approach, which requires MSbits at top
    -
    3869  k = stbi__bit_reverse(a->code_buffer, 16);
    -
    3870  for (s=STBI__ZFAST_BITS+1; ; ++s)
    -
    3871  if (k < z->maxcode[s])
    -
    3872  break;
    -
    3873  if (s == 16) return -1; // invalid code!
    -
    3874  // code size is s, so:
    -
    3875  b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
    -
    3876  STBI_ASSERT(z->size[b] == s);
    -
    3877  a->code_buffer >>= s;
    -
    3878  a->num_bits -= s;
    -
    3879  return z->value[b];
    -
    3880 }
    -
    3881 
    -
    3882 stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
    -
    3883 {
    -
    3884  int b,s;
    -
    3885  if (a->num_bits < 16) stbi__fill_bits(a);
    -
    3886  b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
    -
    3887  if (b) {
    -
    3888  s = b >> 9;
    -
    3889  a->code_buffer >>= s;
    -
    3890  a->num_bits -= s;
    -
    3891  return b & 511;
    -
    3892  }
    -
    3893  return stbi__zhuffman_decode_slowpath(a, z);
    -
    3894 }
    -
    3895 
    -
    3896 static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes
    -
    3897 {
    -
    3898  char *q;
    -
    3899  int cur, limit, old_limit;
    -
    3900  z->zout = zout;
    -
    3901  if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
    -
    3902  cur = (int) (z->zout - z->zout_start);
    -
    3903  limit = old_limit = (int) (z->zout_end - z->zout_start);
    -
    3904  while (cur + n > limit)
    -
    3905  limit *= 2;
    -
    3906  q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit);
    -
    3907  STBI_NOTUSED(old_limit);
    -
    3908  if (q == NULL) return stbi__err("outofmem", "Out of memory");
    -
    3909  z->zout_start = q;
    -
    3910  z->zout = q + cur;
    -
    3911  z->zout_end = q + limit;
    -
    3912  return 1;
    -
    3913 }
    -
    3914 
    -
    3915 static int stbi__zlength_base[31] = {
    -
    3916  3,4,5,6,7,8,9,10,11,13,
    -
    3917  15,17,19,23,27,31,35,43,51,59,
    -
    3918  67,83,99,115,131,163,195,227,258,0,0 };
    -
    3919 
    -
    3920 static int stbi__zlength_extra[31]=
    -
    3921 { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
    -
    3922 
    -
    3923 static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
    -
    3924 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
    +
    3836  for (; i + 7 < count; i += 8) {
    +
    3837  // load
    +
    3838  __m128i y_bytes = _mm_loadl_epi64((__m128i *)(y + i));
    +
    3839  __m128i cr_bytes = _mm_loadl_epi64((__m128i *)(pcr + i));
    +
    3840  __m128i cb_bytes = _mm_loadl_epi64((__m128i *)(pcb + i));
    +
    3841  __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
    +
    3842  __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
    +
    3843 
    +
    3844  // unpack to short (and left-shift cr, cb by 8)
    +
    3845  __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);
    +
    3846  __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
    +
    3847  __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
    +
    3848 
    +
    3849  // color transform
    +
    3850  __m128i yws = _mm_srli_epi16(yw, 4);
    +
    3851  __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
    +
    3852  __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
    +
    3853  __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
    +
    3854  __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
    +
    3855  __m128i rws = _mm_add_epi16(cr0, yws);
    +
    3856  __m128i gwt = _mm_add_epi16(cb0, yws);
    +
    3857  __m128i bws = _mm_add_epi16(yws, cb1);
    +
    3858  __m128i gws = _mm_add_epi16(gwt, cr1);
    +
    3859 
    +
    3860  // descale
    +
    3861  __m128i rw = _mm_srai_epi16(rws, 4);
    +
    3862  __m128i bw = _mm_srai_epi16(bws, 4);
    +
    3863  __m128i gw = _mm_srai_epi16(gws, 4);
    +
    3864 
    +
    3865  // back to byte, set up for transpose
    +
    3866  __m128i brb = _mm_packus_epi16(rw, bw);
    +
    3867  __m128i gxb = _mm_packus_epi16(gw, xw);
    +
    3868 
    +
    3869  // transpose to interleave channels
    +
    3870  __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
    +
    3871  __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
    +
    3872  __m128i o0 = _mm_unpacklo_epi16(t0, t1);
    +
    3873  __m128i o1 = _mm_unpackhi_epi16(t0, t1);
    +
    3874 
    +
    3875  // store
    +
    3876  _mm_storeu_si128((__m128i *)(out + 0), o0);
    +
    3877  _mm_storeu_si128((__m128i *)(out + 16), o1);
    +
    3878  out += 32;
    +
    3879  }
    +
    3880  }
    +
    3881 #endif
    +
    3882 
    +
    3883 #ifdef STBI_NEON
    +
    3884  // in this version, step=3 support would be easy to add. but is there
    +
    3885  // demand?
    +
    3886  if (step == 4) {
    +
    3887  // this is a fairly straightforward implementation and not
    +
    3888  // super-optimized.
    +
    3889  uint8x8_t signflip = vdup_n_u8(0x80);
    +
    3890  int16x8_t cr_const0 = vdupq_n_s16((short)(1.40200f * 4096.0f + 0.5f));
    +
    3891  int16x8_t cr_const1 = vdupq_n_s16(-(short)(0.71414f * 4096.0f + 0.5f));
    +
    3892  int16x8_t cb_const0 = vdupq_n_s16(-(short)(0.34414f * 4096.0f + 0.5f));
    +
    3893  int16x8_t cb_const1 = vdupq_n_s16((short)(1.77200f * 4096.0f + 0.5f));
    +
    3894 
    +
    3895  for (; i + 7 < count; i += 8) {
    +
    3896  // load
    +
    3897  uint8x8_t y_bytes = vld1_u8(y + i);
    +
    3898  uint8x8_t cr_bytes = vld1_u8(pcr + i);
    +
    3899  uint8x8_t cb_bytes = vld1_u8(pcb + i);
    +
    3900  int8x8_t cr_biased =
    +
    3901  vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
    +
    3902  int8x8_t cb_biased =
    +
    3903  vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
    +
    3904 
    +
    3905  // expand to s16
    +
    3906  int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
    +
    3907  int16x8_t crw = vshll_n_s8(cr_biased, 7);
    +
    3908  int16x8_t cbw = vshll_n_s8(cb_biased, 7);
    +
    3909 
    +
    3910  // color transform
    +
    3911  int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
    +
    3912  int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
    +
    3913  int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
    +
    3914  int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
    +
    3915  int16x8_t rws = vaddq_s16(yws, cr0);
    +
    3916  int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
    +
    3917  int16x8_t bws = vaddq_s16(yws, cb1);
    +
    3918 
    +
    3919  // undo scaling, round, convert to byte
    +
    3920  uint8x8x4_t o;
    +
    3921  o.val[0] = vqrshrun_n_s16(rws, 4);
    +
    3922  o.val[1] = vqrshrun_n_s16(gws, 4);
    +
    3923  o.val[2] = vqrshrun_n_s16(bws, 4);
    +
    3924  o.val[3] = vdup_n_u8(255);
    3925 
    -
    3926 static int stbi__zdist_extra[32] =
    -
    3927 { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
    -
    3928 
    -
    3929 static int stbi__parse_huffman_block(stbi__zbuf *a)
    -
    3930 {
    -
    3931  char *zout = a->zout;
    -
    3932  for(;;) {
    -
    3933  int z = stbi__zhuffman_decode(a, &a->z_length);
    -
    3934  if (z < 256) {
    -
    3935  if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
    -
    3936  if (zout >= a->zout_end) {
    -
    3937  if (!stbi__zexpand(a, zout, 1)) return 0;
    -
    3938  zout = a->zout;
    -
    3939  }
    -
    3940  *zout++ = (char) z;
    -
    3941  } else {
    -
    3942  stbi_uc *p;
    -
    3943  int len,dist;
    -
    3944  if (z == 256) {
    -
    3945  a->zout = zout;
    -
    3946  return 1;
    -
    3947  }
    -
    3948  z -= 257;
    -
    3949  len = stbi__zlength_base[z];
    -
    3950  if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
    -
    3951  z = stbi__zhuffman_decode(a, &a->z_distance);
    -
    3952  if (z < 0) return stbi__err("bad huffman code","Corrupt PNG");
    -
    3953  dist = stbi__zdist_base[z];
    -
    3954  if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
    -
    3955  if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
    -
    3956  if (zout + len > a->zout_end) {
    -
    3957  if (!stbi__zexpand(a, zout, len)) return 0;
    -
    3958  zout = a->zout;
    -
    3959  }
    -
    3960  p = (stbi_uc *) (zout - dist);
    -
    3961  if (dist == 1) { // run of one byte; common in images.
    -
    3962  stbi_uc v = *p;
    -
    3963  if (len) { do *zout++ = v; while (--len); }
    -
    3964  } else {
    -
    3965  if (len) { do *zout++ = *p++; while (--len); }
    -
    3966  }
    -
    3967  }
    -
    3968  }
    +
    3926  // store, interleaving r/g/b/a
    +
    3927  vst4_u8(out, o);
    +
    3928  out += 8 * 4;
    +
    3929  }
    +
    3930  }
    +
    3931 #endif
    +
    3932 
    +
    3933  for (; i < count; ++i) {
    +
    3934  int y_fixed = (y[i] << 20) + (1 << 19); // rounding
    +
    3935  int r, g, b;
    +
    3936  int cr = pcr[i] - 128;
    +
    3937  int cb = pcb[i] - 128;
    +
    3938  r = y_fixed + cr * stbi__float2fixed(1.40200f);
    +
    3939  g = y_fixed + cr * -stbi__float2fixed(0.71414f) +
    +
    3940  ((cb * -stbi__float2fixed(0.34414f)) & 0xffff0000);
    +
    3941  b = y_fixed + cb * stbi__float2fixed(1.77200f);
    +
    3942  r >>= 20;
    +
    3943  g >>= 20;
    +
    3944  b >>= 20;
    +
    3945  if ((unsigned)r > 255) {
    +
    3946  if (r < 0)
    +
    3947  r = 0;
    +
    3948  else
    +
    3949  r = 255;
    +
    3950  }
    +
    3951  if ((unsigned)g > 255) {
    +
    3952  if (g < 0)
    +
    3953  g = 0;
    +
    3954  else
    +
    3955  g = 255;
    +
    3956  }
    +
    3957  if ((unsigned)b > 255) {
    +
    3958  if (b < 0)
    +
    3959  b = 0;
    +
    3960  else
    +
    3961  b = 255;
    +
    3962  }
    +
    3963  out[0] = (stbi_uc)r;
    +
    3964  out[1] = (stbi_uc)g;
    +
    3965  out[2] = (stbi_uc)b;
    +
    3966  out[3] = 255;
    +
    3967  out += step;
    +
    3968  }
    3969 }
    -
    3970 
    -
    3971 static int stbi__compute_huffman_codes(stbi__zbuf *a)
    -
    3972 {
    -
    3973  static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
    -
    3974  stbi__zhuffman z_codelength;
    -
    3975  stbi_uc lencodes[286+32+137];//padding for maximum single op
    -
    3976  stbi_uc codelength_sizes[19];
    -
    3977  int i,n;
    +
    3970 #endif
    +
    3971 
    +
    3972 // set up the kernels
    +
    3973 static void stbi__setup_jpeg(stbi__jpeg *j)
    +
    3974 {
    +
    3975  j->idct_block_kernel = stbi__idct_block;
    +
    3976  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
    +
    3977  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
    3978 
    -
    3979  int hlit = stbi__zreceive(a,5) + 257;
    -
    3980  int hdist = stbi__zreceive(a,5) + 1;
    -
    3981  int hclen = stbi__zreceive(a,4) + 4;
    -
    3982  int ntot = hlit + hdist;
    -
    3983 
    -
    3984  memset(codelength_sizes, 0, sizeof(codelength_sizes));
    -
    3985  for (i=0; i < hclen; ++i) {
    -
    3986  int s = stbi__zreceive(a,3);
    -
    3987  codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;
    -
    3988  }
    -
    3989  if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
    -
    3990 
    -
    3991  n = 0;
    -
    3992  while (n < ntot) {
    -
    3993  int c = stbi__zhuffman_decode(a, &z_codelength);
    -
    3994  if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
    -
    3995  if (c < 16)
    -
    3996  lencodes[n++] = (stbi_uc) c;
    -
    3997  else {
    -
    3998  stbi_uc fill = 0;
    -
    3999  if (c == 16) {
    -
    4000  c = stbi__zreceive(a,2)+3;
    -
    4001  if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG");
    -
    4002  fill = lencodes[n-1];
    -
    4003  } else if (c == 17)
    -
    4004  c = stbi__zreceive(a,3)+3;
    -
    4005  else {
    -
    4006  STBI_ASSERT(c == 18);
    -
    4007  c = stbi__zreceive(a,7)+11;
    -
    4008  }
    -
    4009  if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG");
    -
    4010  memset(lencodes+n, fill, c);
    -
    4011  n += c;
    -
    4012  }
    -
    4013  }
    -
    4014  if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG");
    -
    4015  if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
    -
    4016  if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
    -
    4017  return 1;
    -
    4018 }
    -
    4019 
    -
    4020 static int stbi__parse_uncompressed_block(stbi__zbuf *a)
    -
    4021 {
    -
    4022  stbi_uc header[4];
    -
    4023  int len,nlen,k;
    -
    4024  if (a->num_bits & 7)
    -
    4025  stbi__zreceive(a, a->num_bits & 7); // discard
    -
    4026  // drain the bit-packed data into header
    -
    4027  k = 0;
    -
    4028  while (a->num_bits > 0) {
    -
    4029  header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check
    -
    4030  a->code_buffer >>= 8;
    -
    4031  a->num_bits -= 8;
    -
    4032  }
    -
    4033  STBI_ASSERT(a->num_bits == 0);
    -
    4034  // now fill header the normal way
    -
    4035  while (k < 4)
    -
    4036  header[k++] = stbi__zget8(a);
    -
    4037  len = header[1] * 256 + header[0];
    -
    4038  nlen = header[3] * 256 + header[2];
    -
    4039  if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
    -
    4040  if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
    -
    4041  if (a->zout + len > a->zout_end)
    -
    4042  if (!stbi__zexpand(a, a->zout, len)) return 0;
    -
    4043  memcpy(a->zout, a->zbuffer, len);
    -
    4044  a->zbuffer += len;
    -
    4045  a->zout += len;
    -
    4046  return 1;
    -
    4047 }
    -
    4048 
    -
    4049 static int stbi__parse_zlib_header(stbi__zbuf *a)
    -
    4050 {
    -
    4051  int cmf = stbi__zget8(a);
    -
    4052  int cm = cmf & 15;
    -
    4053  /* int cinfo = cmf >> 4; */
    -
    4054  int flg = stbi__zget8(a);
    -
    4055  if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
    -
    4056  if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
    -
    4057  if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png
    -
    4058  // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
    -
    4059  return 1;
    -
    4060 }
    -
    4061 
    -
    4062 static const stbi_uc stbi__zdefault_length[288] =
    -
    4063 {
    -
    4064  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
    -
    4065  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
    -
    4066  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
    -
    4067  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
    -
    4068  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
    -
    4069  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
    -
    4070  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
    -
    4071  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
    -
    4072  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8
    -
    4073 };
    -
    4074 static const stbi_uc stbi__zdefault_distance[32] =
    -
    4075 {
    -
    4076  5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
    -
    4077 };
    -
    4078 /*
    -
    4079 Init algorithm:
    -
    4080 {
    -
    4081  int i; // use <= to match clearly with spec
    -
    4082  for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
    -
    4083  for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9;
    -
    4084  for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7;
    -
    4085  for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8;
    -
    4086 
    -
    4087  for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
    -
    4088 }
    -
    4089 */
    -
    4090 
    -
    4091 static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
    -
    4092 {
    -
    4093  int final, type;
    -
    4094  if (parse_header)
    -
    4095  if (!stbi__parse_zlib_header(a)) return 0;
    -
    4096  a->num_bits = 0;
    -
    4097  a->code_buffer = 0;
    -
    4098  do {
    -
    4099  final = stbi__zreceive(a,1);
    -
    4100  type = stbi__zreceive(a,2);
    -
    4101  if (type == 0) {
    -
    4102  if (!stbi__parse_uncompressed_block(a)) return 0;
    -
    4103  } else if (type == 3) {
    -
    4104  return 0;
    -
    4105  } else {
    -
    4106  if (type == 1) {
    -
    4107  // use fixed code lengths
    -
    4108  if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;
    -
    4109  if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
    -
    4110  } else {
    -
    4111  if (!stbi__compute_huffman_codes(a)) return 0;
    -
    4112  }
    -
    4113  if (!stbi__parse_huffman_block(a)) return 0;
    -
    4114  }
    -
    4115  } while (!final);
    -
    4116  return 1;
    -
    4117 }
    -
    4118 
    -
    4119 static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)
    -
    4120 {
    -
    4121  a->zout_start = obuf;
    -
    4122  a->zout = obuf;
    -
    4123  a->zout_end = obuf + olen;
    -
    4124  a->z_expandable = exp;
    -
    4125 
    -
    4126  return stbi__parse_zlib(a, parse_header);
    -
    4127 }
    -
    4128 
    -
    4129 STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
    -
    4130 {
    -
    4131  stbi__zbuf a;
    -
    4132  char *p = (char *) stbi__malloc(initial_size);
    -
    4133  if (p == NULL) return NULL;
    -
    4134  a.zbuffer = (stbi_uc *) buffer;
    -
    4135  a.zbuffer_end = (stbi_uc *) buffer + len;
    -
    4136  if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {
    -
    4137  if (outlen) *outlen = (int) (a.zout - a.zout_start);
    -
    4138  return a.zout_start;
    -
    4139  } else {
    -
    4140  STBI_FREE(a.zout_start);
    -
    4141  return NULL;
    -
    4142  }
    -
    4143 }
    -
    4144 
    -
    4145 STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
    -
    4146 {
    -
    4147  return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
    -
    4148 }
    -
    4149 
    -
    4150 STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
    -
    4151 {
    -
    4152  stbi__zbuf a;
    -
    4153  char *p = (char *) stbi__malloc(initial_size);
    -
    4154  if (p == NULL) return NULL;
    -
    4155  a.zbuffer = (stbi_uc *) buffer;
    -
    4156  a.zbuffer_end = (stbi_uc *) buffer + len;
    -
    4157  if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {
    -
    4158  if (outlen) *outlen = (int) (a.zout - a.zout_start);
    -
    4159  return a.zout_start;
    -
    4160  } else {
    -
    4161  STBI_FREE(a.zout_start);
    -
    4162  return NULL;
    -
    4163  }
    -
    4164 }
    -
    4165 
    -
    4166 STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
    -
    4167 {
    -
    4168  stbi__zbuf a;
    -
    4169  a.zbuffer = (stbi_uc *) ibuffer;
    -
    4170  a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
    -
    4171  if (stbi__do_zlib(&a, obuffer, olen, 0, 1))
    -
    4172  return (int) (a.zout - a.zout_start);
    -
    4173  else
    -
    4174  return -1;
    -
    4175 }
    -
    4176 
    -
    4177 STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
    -
    4178 {
    -
    4179  stbi__zbuf a;
    -
    4180  char *p = (char *) stbi__malloc(16384);
    -
    4181  if (p == NULL) return NULL;
    -
    4182  a.zbuffer = (stbi_uc *) buffer;
    -
    4183  a.zbuffer_end = (stbi_uc *) buffer+len;
    -
    4184  if (stbi__do_zlib(&a, p, 16384, 1, 0)) {
    -
    4185  if (outlen) *outlen = (int) (a.zout - a.zout_start);
    -
    4186  return a.zout_start;
    -
    4187  } else {
    -
    4188  STBI_FREE(a.zout_start);
    -
    4189  return NULL;
    -
    4190  }
    -
    4191 }
    -
    4192 
    -
    4193 STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
    -
    4194 {
    -
    4195  stbi__zbuf a;
    -
    4196  a.zbuffer = (stbi_uc *) ibuffer;
    -
    4197  a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
    -
    4198  if (stbi__do_zlib(&a, obuffer, olen, 0, 0))
    -
    4199  return (int) (a.zout - a.zout_start);
    -
    4200  else
    -
    4201  return -1;
    -
    4202 }
    -
    4203 #endif
    -
    4204 
    -
    4205 // public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
    -
    4206 // simple implementation
    -
    4207 // - only 8-bit samples
    -
    4208 // - no CRC checking
    -
    4209 // - allocates lots of intermediate memory
    -
    4210 // - avoids problem of streaming data between subsystems
    -
    4211 // - avoids explicit window management
    -
    4212 // performance
    -
    4213 // - uses stb_zlib, a PD zlib implementation with fast huffman decoding
    -
    4214 
    -
    4215 #ifndef STBI_NO_PNG
    -
    4216 typedef struct
    +
    3979 #ifdef STBI_SSE2
    +
    3980  if (stbi__sse2_available()) {
    +
    3981  j->idct_block_kernel = stbi__idct_simd;
    +
    3982  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
    +
    3983  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
    +
    3984  }
    +
    3985 #endif
    +
    3986 
    +
    3987 #ifdef STBI_NEON
    +
    3988  j->idct_block_kernel = stbi__idct_simd;
    +
    3989  j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
    +
    3990  j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
    +
    3991 #endif
    +
    3992 }
    +
    3993 
    +
    3994 // clean up the temporary component buffers
    +
    3995 static void stbi__cleanup_jpeg(stbi__jpeg *j)
    +
    3996 {
    +
    3997  stbi__free_jpeg_components(j, j->s->img_n, 0);
    +
    3998 }
    +
    3999 
    +
    4000 typedef struct {
    +
    4001  resample_row_func resample;
    +
    4002  stbi_uc *line0, *line1;
    +
    4003  int hs, vs; // expansion factor in each axis
    +
    4004  int w_lores; // horizontal pixels pre-expansion
    +
    4005  int ystep; // how far through vertical expansion we are
    +
    4006  int ypos; // which pre-expansion row we're on
    +
    4007 } stbi__resample;
    +
    4008 
    +
    4009 // fast 0..255 * 0..255 => 0..255 rounded multiplication
    +
    4010 static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
    +
    4011 {
    +
    4012  unsigned int t = x * y + 128;
    +
    4013  return (stbi_uc)((t + (t >> 8)) >> 8);
    +
    4014 }
    +
    4015 
    +
    4016 static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y,
    +
    4017  int *comp, int req_comp)
    +
    4018 {
    +
    4019  int n, decode_n, is_rgb;
    +
    4020  z->s->img_n = 0; // make stbi__cleanup_jpeg safe
    +
    4021 
    +
    4022  // validate req_comp
    +
    4023  if (req_comp < 0 || req_comp > 4)
    +
    4024  return stbi__errpuc("bad req_comp", "Internal error");
    +
    4025 
    +
    4026  // load a jpeg image from whichever source, but leave in YCbCr format
    +
    4027  if (!stbi__decode_jpeg_image(z)) {
    +
    4028  stbi__cleanup_jpeg(z);
    +
    4029  return NULL;
    +
    4030  }
    +
    4031 
    +
    4032  // determine actual number of components to generate
    +
    4033  n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1;
    +
    4034 
    +
    4035  is_rgb = z->s->img_n == 3 &&
    +
    4036  (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif));
    +
    4037 
    +
    4038  if (z->s->img_n == 3 && n < 3 && !is_rgb)
    +
    4039  decode_n = 1;
    +
    4040  else
    +
    4041  decode_n = z->s->img_n;
    +
    4042 
    +
    4043  // resample and color-convert
    +
    4044  {
    +
    4045  int k;
    +
    4046  unsigned int i, j;
    +
    4047  stbi_uc *output;
    +
    4048  stbi_uc *coutput[4];
    +
    4049 
    +
    4050  stbi__resample res_comp[4];
    +
    4051 
    +
    4052  for (k = 0; k < decode_n; ++k) {
    +
    4053  stbi__resample *r = &res_comp[k];
    +
    4054 
    +
    4055  // allocate line buffer big enough for upsampling off the edges
    +
    4056  // with upsample factor of 4
    +
    4057  z->img_comp[k].linebuf = (stbi_uc *)stbi__malloc(z->s->img_x + 3);
    +
    4058  if (!z->img_comp[k].linebuf) {
    +
    4059  stbi__cleanup_jpeg(z);
    +
    4060  return stbi__errpuc("outofmem", "Out of memory");
    +
    4061  }
    +
    4062 
    +
    4063  r->hs = z->img_h_max / z->img_comp[k].h;
    +
    4064  r->vs = z->img_v_max / z->img_comp[k].v;
    +
    4065  r->ystep = r->vs >> 1;
    +
    4066  r->w_lores = (z->s->img_x + r->hs - 1) / r->hs;
    +
    4067  r->ypos = 0;
    +
    4068  r->line0 = r->line1 = z->img_comp[k].data;
    +
    4069 
    +
    4070  if (r->hs == 1 && r->vs == 1)
    +
    4071  r->resample = resample_row_1;
    +
    4072  else if (r->hs == 1 && r->vs == 2)
    +
    4073  r->resample = stbi__resample_row_v_2;
    +
    4074  else if (r->hs == 2 && r->vs == 1)
    +
    4075  r->resample = stbi__resample_row_h_2;
    +
    4076  else if (r->hs == 2 && r->vs == 2)
    +
    4077  r->resample = z->resample_row_hv_2_kernel;
    +
    4078  else
    +
    4079  r->resample = stbi__resample_row_generic;
    +
    4080  }
    +
    4081 
    +
    4082  // can't error after this so, this is safe
    +
    4083  output = (stbi_uc *)stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1);
    +
    4084  if (!output) {
    +
    4085  stbi__cleanup_jpeg(z);
    +
    4086  return stbi__errpuc("outofmem", "Out of memory");
    +
    4087  }
    +
    4088 
    +
    4089  // now go ahead and resample
    +
    4090  for (j = 0; j < z->s->img_y; ++j) {
    +
    4091  stbi_uc *out = output + n * z->s->img_x * j;
    +
    4092  for (k = 0; k < decode_n; ++k) {
    +
    4093  stbi__resample *r = &res_comp[k];
    +
    4094  int y_bot = r->ystep >= (r->vs >> 1);
    +
    4095  coutput[k] = r->resample(
    +
    4096  z->img_comp[k].linebuf, y_bot ? r->line1 : r->line0,
    +
    4097  y_bot ? r->line0 : r->line1, r->w_lores, r->hs);
    +
    4098  if (++r->ystep >= r->vs) {
    +
    4099  r->ystep = 0;
    +
    4100  r->line0 = r->line1;
    +
    4101  if (++r->ypos < z->img_comp[k].y)
    +
    4102  r->line1 += z->img_comp[k].w2;
    +
    4103  }
    +
    4104  }
    +
    4105  if (n >= 3) {
    +
    4106  stbi_uc *y = coutput[0];
    +
    4107  if (z->s->img_n == 3) {
    +
    4108  if (is_rgb) {
    +
    4109  for (i = 0; i < z->s->img_x; ++i) {
    +
    4110  out[0] = y[i];
    +
    4111  out[1] = coutput[1][i];
    +
    4112  out[2] = coutput[2][i];
    +
    4113  out[3] = 255;
    +
    4114  out += n;
    +
    4115  }
    +
    4116  } else {
    +
    4117  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2],
    +
    4118  z->s->img_x, n);
    +
    4119  }
    +
    4120  } else if (z->s->img_n == 4) {
    +
    4121  if (z->app14_color_transform == 0) { // CMYK
    +
    4122  for (i = 0; i < z->s->img_x; ++i) {
    +
    4123  stbi_uc m = coutput[3][i];
    +
    4124  out[0] = stbi__blinn_8x8(coutput[0][i], m);
    +
    4125  out[1] = stbi__blinn_8x8(coutput[1][i], m);
    +
    4126  out[2] = stbi__blinn_8x8(coutput[2][i], m);
    +
    4127  out[3] = 255;
    +
    4128  out += n;
    +
    4129  }
    +
    4130  } else if (z->app14_color_transform == 2) { // YCCK
    +
    4131  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2],
    +
    4132  z->s->img_x, n);
    +
    4133  for (i = 0; i < z->s->img_x; ++i) {
    +
    4134  stbi_uc m = coutput[3][i];
    +
    4135  out[0] = stbi__blinn_8x8(255 - out[0], m);
    +
    4136  out[1] = stbi__blinn_8x8(255 - out[1], m);
    +
    4137  out[2] = stbi__blinn_8x8(255 - out[2], m);
    +
    4138  out += n;
    +
    4139  }
    +
    4140  } else { // YCbCr + alpha? Ignore the fourth channel for
    +
    4141  // now
    +
    4142  z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2],
    +
    4143  z->s->img_x, n);
    +
    4144  }
    +
    4145  } else
    +
    4146  for (i = 0; i < z->s->img_x; ++i) {
    +
    4147  out[0] = out[1] = out[2] = y[i];
    +
    4148  out[3] = 255; // not used if n==3
    +
    4149  out += n;
    +
    4150  }
    +
    4151  } else {
    +
    4152  if (is_rgb) {
    +
    4153  if (n == 1)
    +
    4154  for (i = 0; i < z->s->img_x; ++i)
    +
    4155  *out++ = stbi__compute_y(
    +
    4156  coutput[0][i], coutput[1][i], coutput[2][i]);
    +
    4157  else {
    +
    4158  for (i = 0; i < z->s->img_x; ++i, out += 2) {
    +
    4159  out[0] = stbi__compute_y(
    +
    4160  coutput[0][i], coutput[1][i], coutput[2][i]);
    +
    4161  out[1] = 255;
    +
    4162  }
    +
    4163  }
    +
    4164  } else if (z->s->img_n == 4 && z->app14_color_transform == 0) {
    +
    4165  for (i = 0; i < z->s->img_x; ++i) {
    +
    4166  stbi_uc m = coutput[3][i];
    +
    4167  stbi_uc r = stbi__blinn_8x8(coutput[0][i], m);
    +
    4168  stbi_uc g = stbi__blinn_8x8(coutput[1][i], m);
    +
    4169  stbi_uc b = stbi__blinn_8x8(coutput[2][i], m);
    +
    4170  out[0] = stbi__compute_y(r, g, b);
    +
    4171  out[1] = 255;
    +
    4172  out += n;
    +
    4173  }
    +
    4174  } else if (z->s->img_n == 4 && z->app14_color_transform == 2) {
    +
    4175  for (i = 0; i < z->s->img_x; ++i) {
    +
    4176  out[0] =
    +
    4177  stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]);
    +
    4178  out[1] = 255;
    +
    4179  out += n;
    +
    4180  }
    +
    4181  } else {
    +
    4182  stbi_uc *y = coutput[0];
    +
    4183  if (n == 1)
    +
    4184  for (i = 0; i < z->s->img_x; ++i)
    +
    4185  out[i] = y[i];
    +
    4186  else
    +
    4187  for (i = 0; i < z->s->img_x; ++i)
    +
    4188  *out++ = y[i], *out++ = 255;
    +
    4189  }
    +
    4190  }
    +
    4191  }
    +
    4192  stbi__cleanup_jpeg(z);
    +
    4193  *out_x = z->s->img_x;
    +
    4194  *out_y = z->s->img_y;
    +
    4195  if (comp)
    +
    4196  *comp = z->s->img_n >= 3
    +
    4197  ? 3
    +
    4198  : 1; // report original components, not output
    +
    4199  return output;
    +
    4200  }
    +
    4201 }
    +
    4202 
    +
    4203 static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp,
    +
    4204  int req_comp, stbi__result_info *ri)
    +
    4205 {
    +
    4206  unsigned char *result;
    +
    4207  stbi__jpeg *j = (stbi__jpeg *)stbi__malloc(sizeof(stbi__jpeg));
    +
    4208  STBI_NOTUSED(ri);
    +
    4209  j->s = s;
    +
    4210  stbi__setup_jpeg(j);
    +
    4211  result = load_jpeg_image(j, x, y, comp, req_comp);
    +
    4212  STBI_FREE(j);
    +
    4213  return result;
    +
    4214 }
    +
    4215 
    +
    4216 static int stbi__jpeg_test(stbi__context *s)
    4217 {
    -
    4218  stbi__uint32 length;
    -
    4219  stbi__uint32 type;
    -
    4220 } stbi__pngchunk;
    -
    4221 
    -
    4222 static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
    -
    4223 {
    -
    4224  stbi__pngchunk c;
    -
    4225  c.length = stbi__get32be(s);
    -
    4226  c.type = stbi__get32be(s);
    -
    4227  return c;
    -
    4228 }
    -
    4229 
    -
    4230 static int stbi__check_png_header(stbi__context *s)
    -
    4231 {
    -
    4232  static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };
    -
    4233  int i;
    -
    4234  for (i=0; i < 8; ++i)
    -
    4235  if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG");
    -
    4236  return 1;
    -
    4237 }
    -
    4238 
    -
    4239 typedef struct
    -
    4240 {
    -
    4241  stbi__context *s;
    -
    4242  stbi_uc *idata, *expanded, *out;
    -
    4243  int depth;
    -
    4244 } stbi__png;
    -
    4245 
    -
    4246 
    -
    4247 enum {
    -
    4248  STBI__F_none=0,
    -
    4249  STBI__F_sub=1,
    -
    4250  STBI__F_up=2,
    -
    4251  STBI__F_avg=3,
    -
    4252  STBI__F_paeth=4,
    -
    4253  // synthetic filters used for first scanline to avoid needing a dummy row of 0s
    -
    4254  STBI__F_avg_first,
    -
    4255  STBI__F_paeth_first
    -
    4256 };
    -
    4257 
    -
    4258 static stbi_uc first_row_filter[5] =
    -
    4259 {
    -
    4260  STBI__F_none,
    -
    4261  STBI__F_sub,
    -
    4262  STBI__F_none,
    -
    4263  STBI__F_avg_first,
    -
    4264  STBI__F_paeth_first
    -
    4265 };
    -
    4266 
    -
    4267 static int stbi__paeth(int a, int b, int c)
    -
    4268 {
    -
    4269  int p = a + b - c;
    -
    4270  int pa = abs(p-a);
    -
    4271  int pb = abs(p-b);
    -
    4272  int pc = abs(p-c);
    -
    4273  if (pa <= pb && pa <= pc) return a;
    -
    4274  if (pb <= pc) return b;
    -
    4275  return c;
    -
    4276 }
    -
    4277 
    -
    4278 static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };
    -
    4279 
    -
    4280 // create the png data from post-deflated data
    -
    4281 static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)
    -
    4282 {
    -
    4283  int bytes = (depth == 16? 2 : 1);
    -
    4284  stbi__context *s = a->s;
    -
    4285  stbi__uint32 i,j,stride = x*out_n*bytes;
    -
    4286  stbi__uint32 img_len, img_width_bytes;
    -
    4287  int k;
    -
    4288  int img_n = s->img_n; // copy it into a local for later
    -
    4289 
    -
    4290  int output_bytes = out_n*bytes;
    -
    4291  int filter_bytes = img_n*bytes;
    -
    4292  int width = x;
    -
    4293 
    -
    4294  STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
    -
    4295  a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into
    -
    4296  if (!a->out) return stbi__err("outofmem", "Out of memory");
    -
    4297 
    -
    4298  img_width_bytes = (((img_n * x * depth) + 7) >> 3);
    -
    4299  img_len = (img_width_bytes + 1) * y;
    -
    4300  // we used to check for exact match between raw_len and img_len on non-interlaced PNGs,
    -
    4301  // but issue #276 reported a PNG in the wild that had extra data at the end (all zeros),
    -
    4302  // so just check for raw_len < img_len always.
    -
    4303  if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
    -
    4304 
    -
    4305  for (j=0; j < y; ++j) {
    -
    4306  stbi_uc *cur = a->out + stride*j;
    -
    4307  stbi_uc *prior;
    -
    4308  int filter = *raw++;
    -
    4309 
    -
    4310  if (filter > 4)
    -
    4311  return stbi__err("invalid filter","Corrupt PNG");
    -
    4312 
    -
    4313  if (depth < 8) {
    -
    4314  STBI_ASSERT(img_width_bytes <= x);
    -
    4315  cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place
    -
    4316  filter_bytes = 1;
    -
    4317  width = img_width_bytes;
    -
    4318  }
    -
    4319  prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above
    -
    4320 
    -
    4321  // if first row, use special filter that doesn't sample previous row
    -
    4322  if (j == 0) filter = first_row_filter[filter];
    -
    4323 
    -
    4324  // handle first byte explicitly
    -
    4325  for (k=0; k < filter_bytes; ++k) {
    -
    4326  switch (filter) {
    -
    4327  case STBI__F_none : cur[k] = raw[k]; break;
    -
    4328  case STBI__F_sub : cur[k] = raw[k]; break;
    -
    4329  case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
    -
    4330  case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;
    -
    4331  case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;
    -
    4332  case STBI__F_avg_first : cur[k] = raw[k]; break;
    -
    4333  case STBI__F_paeth_first: cur[k] = raw[k]; break;
    -
    4334  }
    -
    4335  }
    -
    4336 
    -
    4337  if (depth == 8) {
    -
    4338  if (img_n != out_n)
    -
    4339  cur[img_n] = 255; // first pixel
    -
    4340  raw += img_n;
    -
    4341  cur += out_n;
    -
    4342  prior += out_n;
    -
    4343  } else if (depth == 16) {
    -
    4344  if (img_n != out_n) {
    -
    4345  cur[filter_bytes] = 255; // first pixel top byte
    -
    4346  cur[filter_bytes+1] = 255; // first pixel bottom byte
    -
    4347  }
    -
    4348  raw += filter_bytes;
    -
    4349  cur += output_bytes;
    -
    4350  prior += output_bytes;
    -
    4351  } else {
    -
    4352  raw += 1;
    -
    4353  cur += 1;
    -
    4354  prior += 1;
    -
    4355  }
    -
    4356 
    -
    4357  // this is a little gross, so that we don't switch per-pixel or per-component
    -
    4358  if (depth < 8 || img_n == out_n) {
    -
    4359  int nk = (width - 1)*filter_bytes;
    -
    4360  #define STBI__CASE(f) \
    -
    4361  case f: \
    -
    4362  for (k=0; k < nk; ++k)
    -
    4363  switch (filter) {
    -
    4364  // "none" filter turns into a memcpy here; make that explicit.
    -
    4365  case STBI__F_none: memcpy(cur, raw, nk); break;
    -
    4366  STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break;
    -
    4367  STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;
    -
    4368  STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break;
    -
    4369  STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break;
    -
    4370  STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break;
    -
    4371  STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break;
    -
    4372  }
    -
    4373  #undef STBI__CASE
    -
    4374  raw += nk;
    -
    4375  } else {
    -
    4376  STBI_ASSERT(img_n+1 == out_n);
    -
    4377  #define STBI__CASE(f) \
    -
    4378  case f: \
    -
    4379  for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \
    -
    4380  for (k=0; k < filter_bytes; ++k)
    -
    4381  switch (filter) {
    -
    4382  STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break;
    -
    4383  STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break;
    -
    4384  STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;
    -
    4385  STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break;
    -
    4386  STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break;
    -
    4387  STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break;
    -
    4388  STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break;
    -
    4389  }
    -
    4390  #undef STBI__CASE
    -
    4391 
    -
    4392  // the loop above sets the high byte of the pixels' alpha, but for
    -
    4393  // 16 bit png files we also need the low byte set. we'll do that here.
    -
    4394  if (depth == 16) {
    -
    4395  cur = a->out + stride*j; // start at the beginning of the row again
    -
    4396  for (i=0; i < x; ++i,cur+=output_bytes) {
    -
    4397  cur[filter_bytes+1] = 255;
    -
    4398  }
    -
    4399  }
    -
    4400  }
    -
    4401  }
    -
    4402 
    -
    4403  // we make a separate pass to expand bits to pixels; for performance,
    -
    4404  // this could run two scanlines behind the above code, so it won't
    -
    4405  // intefere with filtering but will still be in the cache.
    -
    4406  if (depth < 8) {
    -
    4407  for (j=0; j < y; ++j) {
    -
    4408  stbi_uc *cur = a->out + stride*j;
    -
    4409  stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;
    -
    4410  // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit
    -
    4411  // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop
    -
    4412  stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
    -
    4413 
    -
    4414  // note that the final byte might overshoot and write more data than desired.
    -
    4415  // we can allocate enough data that this never writes out of memory, but it
    -
    4416  // could also overwrite the next scanline. can it overwrite non-empty data
    -
    4417  // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.
    -
    4418  // so we need to explicitly clamp the final ones
    -
    4419 
    -
    4420  if (depth == 4) {
    -
    4421  for (k=x*img_n; k >= 2; k-=2, ++in) {
    -
    4422  *cur++ = scale * ((*in >> 4) );
    -
    4423  *cur++ = scale * ((*in ) & 0x0f);
    -
    4424  }
    -
    4425  if (k > 0) *cur++ = scale * ((*in >> 4) );
    -
    4426  } else if (depth == 2) {
    -
    4427  for (k=x*img_n; k >= 4; k-=4, ++in) {
    -
    4428  *cur++ = scale * ((*in >> 6) );
    -
    4429  *cur++ = scale * ((*in >> 4) & 0x03);
    -
    4430  *cur++ = scale * ((*in >> 2) & 0x03);
    -
    4431  *cur++ = scale * ((*in ) & 0x03);
    -
    4432  }
    -
    4433  if (k > 0) *cur++ = scale * ((*in >> 6) );
    -
    4434  if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);
    -
    4435  if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);
    -
    4436  } else if (depth == 1) {
    -
    4437  for (k=x*img_n; k >= 8; k-=8, ++in) {
    -
    4438  *cur++ = scale * ((*in >> 7) );
    -
    4439  *cur++ = scale * ((*in >> 6) & 0x01);
    -
    4440  *cur++ = scale * ((*in >> 5) & 0x01);
    -
    4441  *cur++ = scale * ((*in >> 4) & 0x01);
    -
    4442  *cur++ = scale * ((*in >> 3) & 0x01);
    -
    4443  *cur++ = scale * ((*in >> 2) & 0x01);
    -
    4444  *cur++ = scale * ((*in >> 1) & 0x01);
    -
    4445  *cur++ = scale * ((*in ) & 0x01);
    -
    4446  }
    -
    4447  if (k > 0) *cur++ = scale * ((*in >> 7) );
    -
    4448  if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);
    -
    4449  if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);
    -
    4450  if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);
    -
    4451  if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);
    -
    4452  if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);
    -
    4453  if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);
    -
    4454  }
    -
    4455  if (img_n != out_n) {
    -
    4456  int q;
    -
    4457  // insert alpha = 255
    -
    4458  cur = a->out + stride*j;
    -
    4459  if (img_n == 1) {
    -
    4460  for (q=x-1; q >= 0; --q) {
    -
    4461  cur[q*2+1] = 255;
    -
    4462  cur[q*2+0] = cur[q];
    -
    4463  }
    -
    4464  } else {
    -
    4465  STBI_ASSERT(img_n == 3);
    -
    4466  for (q=x-1; q >= 0; --q) {
    -
    4467  cur[q*4+3] = 255;
    -
    4468  cur[q*4+2] = cur[q*3+2];
    -
    4469  cur[q*4+1] = cur[q*3+1];
    -
    4470  cur[q*4+0] = cur[q*3+0];
    -
    4471  }
    -
    4472  }
    -
    4473  }
    -
    4474  }
    -
    4475  } else if (depth == 16) {
    -
    4476  // force the image data from big-endian to platform-native.
    -
    4477  // this is done in a separate pass due to the decoding relying
    -
    4478  // on the data being untouched, but could probably be done
    -
    4479  // per-line during decode if care is taken.
    -
    4480  stbi_uc *cur = a->out;
    -
    4481  stbi__uint16 *cur16 = (stbi__uint16*)cur;
    -
    4482 
    -
    4483  for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) {
    -
    4484  *cur16 = (cur[0] << 8) | cur[1];
    -
    4485  }
    -
    4486  }
    -
    4487 
    -
    4488  return 1;
    -
    4489 }
    -
    4490 
    -
    4491 static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)
    -
    4492 {
    -
    4493  int bytes = (depth == 16 ? 2 : 1);
    -
    4494  int out_bytes = out_n * bytes;
    -
    4495  stbi_uc *final;
    -
    4496  int p;
    -
    4497  if (!interlaced)
    -
    4498  return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);
    -
    4499 
    -
    4500  // de-interlacing
    -
    4501  final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);
    -
    4502  for (p=0; p < 7; ++p) {
    -
    4503  int xorig[] = { 0,4,0,2,0,1,0 };
    -
    4504  int yorig[] = { 0,0,4,0,2,0,1 };
    -
    4505  int xspc[] = { 8,8,4,4,2,2,1 };
    -
    4506  int yspc[] = { 8,8,8,4,4,2,2 };
    -
    4507  int i,j,x,y;
    -
    4508  // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
    -
    4509  x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
    -
    4510  y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
    -
    4511  if (x && y) {
    -
    4512  stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
    -
    4513  if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
    -
    4514  STBI_FREE(final);
    -
    4515  return 0;
    -
    4516  }
    -
    4517  for (j=0; j < y; ++j) {
    -
    4518  for (i=0; i < x; ++i) {
    -
    4519  int out_y = j*yspc[p]+yorig[p];
    -
    4520  int out_x = i*xspc[p]+xorig[p];
    -
    4521  memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes,
    -
    4522  a->out + (j*x+i)*out_bytes, out_bytes);
    -
    4523  }
    -
    4524  }
    -
    4525  STBI_FREE(a->out);
    -
    4526  image_data += img_len;
    -
    4527  image_data_len -= img_len;
    -
    4528  }
    -
    4529  }
    -
    4530  a->out = final;
    -
    4531 
    -
    4532  return 1;
    -
    4533 }
    -
    4534 
    -
    4535 static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
    -
    4536 {
    -
    4537  stbi__context *s = z->s;
    -
    4538  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    -
    4539  stbi_uc *p = z->out;
    -
    4540 
    -
    4541  // compute color-based transparency, assuming we've
    -
    4542  // already got 255 as the alpha value in the output
    -
    4543  STBI_ASSERT(out_n == 2 || out_n == 4);
    -
    4544 
    -
    4545  if (out_n == 2) {
    -
    4546  for (i=0; i < pixel_count; ++i) {
    -
    4547  p[1] = (p[0] == tc[0] ? 0 : 255);
    -
    4548  p += 2;
    -
    4549  }
    -
    4550  } else {
    -
    4551  for (i=0; i < pixel_count; ++i) {
    -
    4552  if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
    -
    4553  p[3] = 0;
    -
    4554  p += 4;
    -
    4555  }
    -
    4556  }
    -
    4557  return 1;
    -
    4558 }
    -
    4559 
    -
    4560 static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n)
    -
    4561 {
    -
    4562  stbi__context *s = z->s;
    -
    4563  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    -
    4564  stbi__uint16 *p = (stbi__uint16*) z->out;
    -
    4565 
    -
    4566  // compute color-based transparency, assuming we've
    -
    4567  // already got 65535 as the alpha value in the output
    -
    4568  STBI_ASSERT(out_n == 2 || out_n == 4);
    -
    4569 
    -
    4570  if (out_n == 2) {
    -
    4571  for (i = 0; i < pixel_count; ++i) {
    -
    4572  p[1] = (p[0] == tc[0] ? 0 : 65535);
    -
    4573  p += 2;
    -
    4574  }
    -
    4575  } else {
    -
    4576  for (i = 0; i < pixel_count; ++i) {
    -
    4577  if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
    -
    4578  p[3] = 0;
    -
    4579  p += 4;
    -
    4580  }
    -
    4581  }
    -
    4582  return 1;
    -
    4583 }
    -
    4584 
    -
    4585 static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n)
    -
    4586 {
    -
    4587  stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
    -
    4588  stbi_uc *p, *temp_out, *orig = a->out;
    -
    4589 
    -
    4590  p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0);
    -
    4591  if (p == NULL) return stbi__err("outofmem", "Out of memory");
    -
    4592 
    -
    4593  // between here and free(out) below, exitting would leak
    -
    4594  temp_out = p;
    -
    4595 
    -
    4596  if (pal_img_n == 3) {
    -
    4597  for (i=0; i < pixel_count; ++i) {
    -
    4598  int n = orig[i]*4;
    -
    4599  p[0] = palette[n ];
    -
    4600  p[1] = palette[n+1];
    -
    4601  p[2] = palette[n+2];
    -
    4602  p += 3;
    -
    4603  }
    -
    4604  } else {
    -
    4605  for (i=0; i < pixel_count; ++i) {
    -
    4606  int n = orig[i]*4;
    -
    4607  p[0] = palette[n ];
    -
    4608  p[1] = palette[n+1];
    -
    4609  p[2] = palette[n+2];
    -
    4610  p[3] = palette[n+3];
    -
    4611  p += 4;
    -
    4612  }
    -
    4613  }
    -
    4614  STBI_FREE(a->out);
    -
    4615  a->out = temp_out;
    -
    4616 
    -
    4617  STBI_NOTUSED(len);
    -
    4618 
    -
    4619  return 1;
    -
    4620 }
    -
    4621 
    -
    4622 static int stbi__unpremultiply_on_load = 0;
    -
    4623 static int stbi__de_iphone_flag = 0;
    -
    4624 
    -
    4625 STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
    -
    4626 {
    -
    4627  stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;
    +
    4218  int r;
    +
    4219  stbi__jpeg *j = (stbi__jpeg *)stbi__malloc(sizeof(stbi__jpeg));
    +
    4220  j->s = s;
    +
    4221  stbi__setup_jpeg(j);
    +
    4222  r = stbi__decode_jpeg_header(j, STBI__SCAN_type);
    +
    4223  stbi__rewind(s);
    +
    4224  STBI_FREE(j);
    +
    4225  return r;
    +
    4226 }
    +
    4227 
    +
    4228 static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
    +
    4229 {
    +
    4230  if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {
    +
    4231  stbi__rewind(j->s);
    +
    4232  return 0;
    +
    4233  }
    +
    4234  if (x)
    +
    4235  *x = j->s->img_x;
    +
    4236  if (y)
    +
    4237  *y = j->s->img_y;
    +
    4238  if (comp)
    +
    4239  *comp = j->s->img_n >= 3 ? 3 : 1;
    +
    4240  return 1;
    +
    4241 }
    +
    4242 
    +
    4243 static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
    +
    4244 {
    +
    4245  int result;
    +
    4246  stbi__jpeg *j = (stbi__jpeg *)(stbi__malloc(sizeof(stbi__jpeg)));
    +
    4247  j->s = s;
    +
    4248  result = stbi__jpeg_info_raw(j, x, y, comp);
    +
    4249  STBI_FREE(j);
    +
    4250  return result;
    +
    4251 }
    +
    4252 #endif
    +
    4253 
    +
    4254  // public domain zlib decode v0.2 Sean Barrett 2006-11-18
    +
    4255  // simple implementation
    +
    4256  // - all input must be provided in an upfront buffer
    +
    4257  // - all output is written to a single output buffer (can
    +
    4258  // malloc/realloc)
    +
    4259  // performance
    +
    4260  // - fast huffman
    +
    4261 
    +
    4262 #ifndef STBI_NO_ZLIB
    +
    4263 
    +
    4264 // fast-way is faster to check than jpeg huffman, but slow way is slower
    +
    4265 #define STBI__ZFAST_BITS 9 // accelerate all cases in default tables
    +
    4266 #define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)
    +
    4267 
    +
    4268 // zlib-style huffman encoding
    +
    4269 // (jpegs packs from left, zlib from right, so can't share code)
    +
    4270 typedef struct {
    +
    4271  stbi__uint16 fast[1 << STBI__ZFAST_BITS];
    +
    4272  stbi__uint16 firstcode[16];
    +
    4273  int maxcode[17];
    +
    4274  stbi__uint16 firstsymbol[16];
    +
    4275  stbi_uc size[288];
    +
    4276  stbi__uint16 value[288];
    +
    4277 } stbi__zhuffman;
    +
    4278 
    +
    4279 stbi_inline static int stbi__bitreverse16(int n)
    +
    4280 {
    +
    4281  n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
    +
    4282  n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
    +
    4283  n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
    +
    4284  n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
    +
    4285  return n;
    +
    4286 }
    +
    4287 
    +
    4288 stbi_inline static int stbi__bit_reverse(int v, int bits)
    +
    4289 {
    +
    4290  STBI_ASSERT(bits <= 16);
    +
    4291  // to bit reverse n bits, reverse 16 and shift
    +
    4292  // e.g. 11 bits, bit reverse and shift away 5
    +
    4293  return stbi__bitreverse16(v) >> (16 - bits);
    +
    4294 }
    +
    4295 
    +
    4296 static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist,
    +
    4297  int num)
    +
    4298 {
    +
    4299  int i, k = 0;
    +
    4300  int code, next_code[16], sizes[17];
    +
    4301 
    +
    4302  // DEFLATE spec for generating codes
    +
    4303  memset(sizes, 0, sizeof(sizes));
    +
    4304  memset(z->fast, 0, sizeof(z->fast));
    +
    4305  for (i = 0; i < num; ++i)
    +
    4306  ++sizes[sizelist[i]];
    +
    4307  sizes[0] = 0;
    +
    4308  for (i = 1; i < 16; ++i)
    +
    4309  if (sizes[i] > (1 << i))
    +
    4310  return stbi__err("bad sizes", "Corrupt PNG");
    +
    4311  code = 0;
    +
    4312  for (i = 1; i < 16; ++i) {
    +
    4313  next_code[i] = code;
    +
    4314  z->firstcode[i] = (stbi__uint16)code;
    +
    4315  z->firstsymbol[i] = (stbi__uint16)k;
    +
    4316  code = (code + sizes[i]);
    +
    4317  if (sizes[i])
    +
    4318  if (code - 1 >= (1 << i))
    +
    4319  return stbi__err("bad codelengths", "Corrupt PNG");
    +
    4320  z->maxcode[i] = code << (16 - i); // preshift for inner loop
    +
    4321  code <<= 1;
    +
    4322  k += sizes[i];
    +
    4323  }
    +
    4324  z->maxcode[16] = 0x10000; // sentinel
    +
    4325  for (i = 0; i < num; ++i) {
    +
    4326  int s = sizelist[i];
    +
    4327  if (s) {
    +
    4328  int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
    +
    4329  stbi__uint16 fastv = (stbi__uint16)((s << 9) | i);
    +
    4330  z->size[c] = (stbi_uc)s;
    +
    4331  z->value[c] = (stbi__uint16)i;
    +
    4332  if (s <= STBI__ZFAST_BITS) {
    +
    4333  int j = stbi__bit_reverse(next_code[s], s);
    +
    4334  while (j < (1 << STBI__ZFAST_BITS)) {
    +
    4335  z->fast[j] = fastv;
    +
    4336  j += (1 << s);
    +
    4337  }
    +
    4338  }
    +
    4339  ++next_code[s];
    +
    4340  }
    +
    4341  }
    +
    4342  return 1;
    +
    4343 }
    +
    4344 
    +
    4345 // zlib-from-memory implementation for PNG reading
    +
    4346 // because PNG allows splitting the zlib stream arbitrarily,
    +
    4347 // and it's annoying structurally to have PNG call ZLIB call PNG,
    +
    4348 // we require PNG read all the IDATs and combine them into a single
    +
    4349 // memory buffer
    +
    4350 
    +
    4351 typedef struct {
    +
    4352  stbi_uc *zbuffer, *zbuffer_end;
    +
    4353  int num_bits;
    +
    4354  stbi__uint32 code_buffer;
    +
    4355 
    +
    4356  char *zout;
    +
    4357  char *zout_start;
    +
    4358  char *zout_end;
    +
    4359  int z_expandable;
    +
    4360 
    +
    4361  stbi__zhuffman z_length, z_distance;
    +
    4362 } stbi__zbuf;
    +
    4363 
    +
    4364 stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
    +
    4365 {
    +
    4366  if (z->zbuffer >= z->zbuffer_end)
    +
    4367  return 0;
    +
    4368  return *z->zbuffer++;
    +
    4369 }
    +
    4370 
    +
    4371 static void stbi__fill_bits(stbi__zbuf *z)
    +
    4372 {
    +
    4373  do {
    +
    4374  STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
    +
    4375  z->code_buffer |= (unsigned int)stbi__zget8(z) << z->num_bits;
    +
    4376  z->num_bits += 8;
    +
    4377  } while (z->num_bits <= 24);
    +
    4378 }
    +
    4379 
    +
    4380 stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)
    +
    4381 {
    +
    4382  unsigned int k;
    +
    4383  if (z->num_bits < n)
    +
    4384  stbi__fill_bits(z);
    +
    4385  k = z->code_buffer & ((1 << n) - 1);
    +
    4386  z->code_buffer >>= n;
    +
    4387  z->num_bits -= n;
    +
    4388  return k;
    +
    4389 }
    +
    4390 
    +
    4391 static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
    +
    4392 {
    +
    4393  int b, s, k;
    +
    4394  // not resolved by fast table, so compute it the slow way
    +
    4395  // use jpeg approach, which requires MSbits at top
    +
    4396  k = stbi__bit_reverse(a->code_buffer, 16);
    +
    4397  for (s = STBI__ZFAST_BITS + 1;; ++s)
    +
    4398  if (k < z->maxcode[s])
    +
    4399  break;
    +
    4400  if (s == 16)
    +
    4401  return -1; // invalid code!
    +
    4402  // code size is s, so:
    +
    4403  b = (k >> (16 - s)) - z->firstcode[s] + z->firstsymbol[s];
    +
    4404  STBI_ASSERT(z->size[b] == s);
    +
    4405  a->code_buffer >>= s;
    +
    4406  a->num_bits -= s;
    +
    4407  return z->value[b];
    +
    4408 }
    +
    4409 
    +
    4410 stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
    +
    4411 {
    +
    4412  int b, s;
    +
    4413  if (a->num_bits < 16)
    +
    4414  stbi__fill_bits(a);
    +
    4415  b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
    +
    4416  if (b) {
    +
    4417  s = b >> 9;
    +
    4418  a->code_buffer >>= s;
    +
    4419  a->num_bits -= s;
    +
    4420  return b & 511;
    +
    4421  }
    +
    4422  return stbi__zhuffman_decode_slowpath(a, z);
    +
    4423 }
    +
    4424 
    +
    4425 static int stbi__zexpand(stbi__zbuf *z, char *zout,
    +
    4426  int n) // need to make room for n bytes
    +
    4427 {
    +
    4428  char *q;
    +
    4429  int cur, limit, old_limit;
    +
    4430  z->zout = zout;
    +
    4431  if (!z->z_expandable)
    +
    4432  return stbi__err("output buffer limit", "Corrupt PNG");
    +
    4433  cur = (int)(z->zout - z->zout_start);
    +
    4434  limit = old_limit = (int)(z->zout_end - z->zout_start);
    +
    4435  while (cur + n > limit)
    +
    4436  limit *= 2;
    +
    4437  q = (char *)STBI_REALLOC_SIZED(z->zout_start, old_limit, limit);
    +
    4438  STBI_NOTUSED(old_limit);
    +
    4439  if (q == NULL)
    +
    4440  return stbi__err("outofmem", "Out of memory");
    +
    4441  z->zout_start = q;
    +
    4442  z->zout = q + cur;
    +
    4443  z->zout_end = q + limit;
    +
    4444  return 1;
    +
    4445 }
    +
    4446 
    +
    4447 static int stbi__zlength_base[31] = {
    +
    4448  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
    +
    4449  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
    +
    4450 
    +
    4451 static int stbi__zlength_extra[31] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
    +
    4452  1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4,
    +
    4453  4, 4, 5, 5, 5, 5, 0, 0, 0};
    +
    4454 
    +
    4455 static int stbi__zdist_base[32] = {
    +
    4456  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33,
    +
    4457  49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537,
    +
    4458  2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0};
    +
    4459 
    +
    4460 static int stbi__zdist_extra[32] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
    +
    4461  4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
    +
    4462  9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
    +
    4463 
    +
    4464 static int stbi__parse_huffman_block(stbi__zbuf *a)
    +
    4465 {
    +
    4466  char *zout = a->zout;
    +
    4467  for (;;) {
    +
    4468  int z = stbi__zhuffman_decode(a, &a->z_length);
    +
    4469  if (z < 256) {
    +
    4470  if (z < 0)
    +
    4471  return stbi__err("bad huffman code",
    +
    4472  "Corrupt PNG"); // error in huffman codes
    +
    4473  if (zout >= a->zout_end) {
    +
    4474  if (!stbi__zexpand(a, zout, 1))
    +
    4475  return 0;
    +
    4476  zout = a->zout;
    +
    4477  }
    +
    4478  *zout++ = (char)z;
    +
    4479  } else {
    +
    4480  stbi_uc *p;
    +
    4481  int len, dist;
    +
    4482  if (z == 256) {
    +
    4483  a->zout = zout;
    +
    4484  return 1;
    +
    4485  }
    +
    4486  z -= 257;
    +
    4487  len = stbi__zlength_base[z];
    +
    4488  if (stbi__zlength_extra[z])
    +
    4489  len += stbi__zreceive(a, stbi__zlength_extra[z]);
    +
    4490  z = stbi__zhuffman_decode(a, &a->z_distance);
    +
    4491  if (z < 0)
    +
    4492  return stbi__err("bad huffman code", "Corrupt PNG");
    +
    4493  dist = stbi__zdist_base[z];
    +
    4494  if (stbi__zdist_extra[z])
    +
    4495  dist += stbi__zreceive(a, stbi__zdist_extra[z]);
    +
    4496  if (zout - a->zout_start < dist)
    +
    4497  return stbi__err("bad dist", "Corrupt PNG");
    +
    4498  if (zout + len > a->zout_end) {
    +
    4499  if (!stbi__zexpand(a, zout, len))
    +
    4500  return 0;
    +
    4501  zout = a->zout;
    +
    4502  }
    +
    4503  p = (stbi_uc *)(zout - dist);
    +
    4504  if (dist == 1) { // run of one byte; common in images.
    +
    4505  stbi_uc v = *p;
    +
    4506  if (len) {
    +
    4507  do
    +
    4508  *zout++ = v;
    +
    4509  while (--len);
    +
    4510  }
    +
    4511  } else {
    +
    4512  if (len) {
    +
    4513  do
    +
    4514  *zout++ = *p++;
    +
    4515  while (--len);
    +
    4516  }
    +
    4517  }
    +
    4518  }
    +
    4519  }
    +
    4520 }
    +
    4521 
    +
    4522 static int stbi__compute_huffman_codes(stbi__zbuf *a)
    +
    4523 {
    +
    4524  static stbi_uc length_dezigzag[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5,
    +
    4525  11, 4, 12, 3, 13, 2, 14, 1, 15};
    +
    4526  stbi__zhuffman z_codelength;
    +
    4527  stbi_uc lencodes[286 + 32 + 137]; // padding for maximum single op
    +
    4528  stbi_uc codelength_sizes[19];
    +
    4529  int i, n;
    +
    4530 
    +
    4531  int hlit = stbi__zreceive(a, 5) + 257;
    +
    4532  int hdist = stbi__zreceive(a, 5) + 1;
    +
    4533  int hclen = stbi__zreceive(a, 4) + 4;
    +
    4534  int ntot = hlit + hdist;
    +
    4535 
    +
    4536  memset(codelength_sizes, 0, sizeof(codelength_sizes));
    +
    4537  for (i = 0; i < hclen; ++i) {
    +
    4538  int s = stbi__zreceive(a, 3);
    +
    4539  codelength_sizes[length_dezigzag[i]] = (stbi_uc)s;
    +
    4540  }
    +
    4541  if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19))
    +
    4542  return 0;
    +
    4543 
    +
    4544  n = 0;
    +
    4545  while (n < ntot) {
    +
    4546  int c = stbi__zhuffman_decode(a, &z_codelength);
    +
    4547  if (c < 0 || c >= 19)
    +
    4548  return stbi__err("bad codelengths", "Corrupt PNG");
    +
    4549  if (c < 16)
    +
    4550  lencodes[n++] = (stbi_uc)c;
    +
    4551  else {
    +
    4552  stbi_uc fill = 0;
    +
    4553  if (c == 16) {
    +
    4554  c = stbi__zreceive(a, 2) + 3;
    +
    4555  if (n == 0)
    +
    4556  return stbi__err("bad codelengths", "Corrupt PNG");
    +
    4557  fill = lencodes[n - 1];
    +
    4558  } else if (c == 17)
    +
    4559  c = stbi__zreceive(a, 3) + 3;
    +
    4560  else {
    +
    4561  STBI_ASSERT(c == 18);
    +
    4562  c = stbi__zreceive(a, 7) + 11;
    +
    4563  }
    +
    4564  if (ntot - n < c)
    +
    4565  return stbi__err("bad codelengths", "Corrupt PNG");
    +
    4566  memset(lencodes + n, fill, c);
    +
    4567  n += c;
    +
    4568  }
    +
    4569  }
    +
    4570  if (n != ntot)
    +
    4571  return stbi__err("bad codelengths", "Corrupt PNG");
    +
    4572  if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit))
    +
    4573  return 0;
    +
    4574  if (!stbi__zbuild_huffman(&a->z_distance, lencodes + hlit, hdist))
    +
    4575  return 0;
    +
    4576  return 1;
    +
    4577 }
    +
    4578 
    +
    4579 static int stbi__parse_uncompressed_block(stbi__zbuf *a)
    +
    4580 {
    +
    4581  stbi_uc header[4];
    +
    4582  int len, nlen, k;
    +
    4583  if (a->num_bits & 7)
    +
    4584  stbi__zreceive(a, a->num_bits & 7); // discard
    +
    4585  // drain the bit-packed data into header
    +
    4586  k = 0;
    +
    4587  while (a->num_bits > 0) {
    +
    4588  header[k++] =
    +
    4589  (stbi_uc)(a->code_buffer & 255); // suppress MSVC run-time check
    +
    4590  a->code_buffer >>= 8;
    +
    4591  a->num_bits -= 8;
    +
    4592  }
    +
    4593  STBI_ASSERT(a->num_bits == 0);
    +
    4594  // now fill header the normal way
    +
    4595  while (k < 4)
    +
    4596  header[k++] = stbi__zget8(a);
    +
    4597  len = header[1] * 256 + header[0];
    +
    4598  nlen = header[3] * 256 + header[2];
    +
    4599  if (nlen != (len ^ 0xffff))
    +
    4600  return stbi__err("zlib corrupt", "Corrupt PNG");
    +
    4601  if (a->zbuffer + len > a->zbuffer_end)
    +
    4602  return stbi__err("read past buffer", "Corrupt PNG");
    +
    4603  if (a->zout + len > a->zout_end)
    +
    4604  if (!stbi__zexpand(a, a->zout, len))
    +
    4605  return 0;
    +
    4606  memcpy(a->zout, a->zbuffer, len);
    +
    4607  a->zbuffer += len;
    +
    4608  a->zout += len;
    +
    4609  return 1;
    +
    4610 }
    +
    4611 
    +
    4612 static int stbi__parse_zlib_header(stbi__zbuf *a)
    +
    4613 {
    +
    4614  int cmf = stbi__zget8(a);
    +
    4615  int cm = cmf & 15;
    +
    4616  /* int cinfo = cmf >> 4; */
    +
    4617  int flg = stbi__zget8(a);
    +
    4618  if ((cmf * 256 + flg) % 31 != 0)
    +
    4619  return stbi__err("bad zlib header", "Corrupt PNG"); // zlib spec
    +
    4620  if (flg & 32)
    +
    4621  return stbi__err("no preset dict",
    +
    4622  "Corrupt PNG"); // preset dictionary not allowed in png
    +
    4623  if (cm != 8)
    +
    4624  return stbi__err("bad compression",
    +
    4625  "Corrupt PNG"); // DEFLATE required for png
    +
    4626  // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
    +
    4627  return 1;
    4628 }
    4629 
    -
    4630 STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
    -
    4631 {
    -
    4632  stbi__de_iphone_flag = flag_true_if_should_convert;
    -
    4633 }
    -
    4634 
    -
    4635 static void stbi__de_iphone(stbi__png *z)
    -
    4636 {
    -
    4637  stbi__context *s = z->s;
    -
    4638  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    -
    4639  stbi_uc *p = z->out;
    -
    4640 
    -
    4641  if (s->img_out_n == 3) { // convert bgr to rgb
    -
    4642  for (i=0; i < pixel_count; ++i) {
    -
    4643  stbi_uc t = p[0];
    -
    4644  p[0] = p[2];
    -
    4645  p[2] = t;
    -
    4646  p += 3;
    -
    4647  }
    -
    4648  } else {
    -
    4649  STBI_ASSERT(s->img_out_n == 4);
    -
    4650  if (stbi__unpremultiply_on_load) {
    -
    4651  // convert bgr to rgb and unpremultiply
    -
    4652  for (i=0; i < pixel_count; ++i) {
    -
    4653  stbi_uc a = p[3];
    -
    4654  stbi_uc t = p[0];
    -
    4655  if (a) {
    -
    4656  stbi_uc half = a / 2;
    -
    4657  p[0] = (p[2] * 255 + half) / a;
    -
    4658  p[1] = (p[1] * 255 + half) / a;
    -
    4659  p[2] = ( t * 255 + half) / a;
    -
    4660  } else {
    -
    4661  p[0] = p[2];
    -
    4662  p[2] = t;
    -
    4663  }
    -
    4664  p += 4;
    -
    4665  }
    -
    4666  } else {
    -
    4667  // convert bgr to rgb
    -
    4668  for (i=0; i < pixel_count; ++i) {
    -
    4669  stbi_uc t = p[0];
    -
    4670  p[0] = p[2];
    -
    4671  p[2] = t;
    -
    4672  p += 4;
    -
    4673  }
    -
    4674  }
    -
    4675  }
    -
    4676 }
    -
    4677 
    -
    4678 #define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
    -
    4679 
    -
    4680 static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
    -
    4681 {
    -
    4682  stbi_uc palette[1024], pal_img_n=0;
    -
    4683  stbi_uc has_trans=0, tc[3];
    -
    4684  stbi__uint16 tc16[3];
    -
    4685  stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
    -
    4686  int first=1,k,interlace=0, color=0, is_iphone=0;
    -
    4687  stbi__context *s = z->s;
    -
    4688 
    -
    4689  z->expanded = NULL;
    -
    4690  z->idata = NULL;
    -
    4691  z->out = NULL;
    -
    4692 
    -
    4693  if (!stbi__check_png_header(s)) return 0;
    +
    4630 static const stbi_uc stbi__zdefault_length[288] = {
    +
    4631  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4632  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4633  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4634  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4635  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4636  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    +
    4637  9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    +
    4638  9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    +
    4639  9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    +
    4640  9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    +
    4641  9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7,
    +
    4642  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8};
    +
    4643 static const stbi_uc stbi__zdefault_distance[32] = {
    +
    4644  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
    +
    4645  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5};
    +
    4646 /*
    +
    4647 Init algorithm:
    +
    4648 {
    +
    4649  int i; // use <= to match clearly with spec
    +
    4650  for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
    +
    4651  for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9;
    +
    4652  for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7;
    +
    4653  for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8;
    +
    4654 
    +
    4655  for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
    +
    4656 }
    +
    4657 */
    +
    4658 
    +
    4659 static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
    +
    4660 {
    +
    4661  int final, type;
    +
    4662  if (parse_header)
    +
    4663  if (!stbi__parse_zlib_header(a))
    +
    4664  return 0;
    +
    4665  a->num_bits = 0;
    +
    4666  a->code_buffer = 0;
    +
    4667  do {
    +
    4668  final = stbi__zreceive(a, 1);
    +
    4669  type = stbi__zreceive(a, 2);
    +
    4670  if (type == 0) {
    +
    4671  if (!stbi__parse_uncompressed_block(a))
    +
    4672  return 0;
    +
    4673  } else if (type == 3) {
    +
    4674  return 0;
    +
    4675  } else {
    +
    4676  if (type == 1) {
    +
    4677  // use fixed code lengths
    +
    4678  if (!stbi__zbuild_huffman(&a->z_length, stbi__zdefault_length,
    +
    4679  288))
    +
    4680  return 0;
    +
    4681  if (!stbi__zbuild_huffman(&a->z_distance,
    +
    4682  stbi__zdefault_distance, 32))
    +
    4683  return 0;
    +
    4684  } else {
    +
    4685  if (!stbi__compute_huffman_codes(a))
    +
    4686  return 0;
    +
    4687  }
    +
    4688  if (!stbi__parse_huffman_block(a))
    +
    4689  return 0;
    +
    4690  }
    +
    4691  } while (!final);
    +
    4692  return 1;
    +
    4693 }
    4694 
    -
    4695  if (scan == STBI__SCAN_type) return 1;
    -
    4696 
    -
    4697  for (;;) {
    -
    4698  stbi__pngchunk c = stbi__get_chunk_header(s);
    -
    4699  switch (c.type) {
    -
    4700  case STBI__PNG_TYPE('C','g','B','I'):
    -
    4701  is_iphone = 1;
    -
    4702  stbi__skip(s, c.length);
    -
    4703  break;
    -
    4704  case STBI__PNG_TYPE('I','H','D','R'): {
    -
    4705  int comp,filter;
    -
    4706  if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
    -
    4707  first = 0;
    -
    4708  if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
    -
    4709  s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
    -
    4710  s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
    -
    4711  z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only");
    -
    4712  color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG");
    -
    4713  if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG");
    -
    4714  if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
    -
    4715  comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG");
    -
    4716  filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG");
    -
    4717  interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
    -
    4718  if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
    -
    4719  if (!pal_img_n) {
    -
    4720  s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
    -
    4721  if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
    -
    4722  if (scan == STBI__SCAN_header) return 1;
    -
    4723  } else {
    -
    4724  // if paletted, then pal_n is our final components, and
    -
    4725  // img_n is # components to decompress/filter.
    -
    4726  s->img_n = 1;
    -
    4727  if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
    -
    4728  // if SCAN_header, have to scan to see if we have a tRNS
    -
    4729  }
    -
    4730  break;
    -
    4731  }
    -
    4732 
    -
    4733  case STBI__PNG_TYPE('P','L','T','E'): {
    -
    4734  if (first) return stbi__err("first not IHDR", "Corrupt PNG");
    -
    4735  if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
    -
    4736  pal_len = c.length / 3;
    -
    4737  if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
    -
    4738  for (i=0; i < pal_len; ++i) {
    -
    4739  palette[i*4+0] = stbi__get8(s);
    -
    4740  palette[i*4+1] = stbi__get8(s);
    -
    4741  palette[i*4+2] = stbi__get8(s);
    -
    4742  palette[i*4+3] = 255;
    -
    4743  }
    -
    4744  break;
    -
    4745  }
    -
    4746 
    -
    4747  case STBI__PNG_TYPE('t','R','N','S'): {
    -
    4748  if (first) return stbi__err("first not IHDR", "Corrupt PNG");
    -
    4749  if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
    -
    4750  if (pal_img_n) {
    -
    4751  if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
    -
    4752  if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
    -
    4753  if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
    -
    4754  pal_img_n = 4;
    -
    4755  for (i=0; i < c.length; ++i)
    -
    4756  palette[i*4+3] = stbi__get8(s);
    -
    4757  } else {
    -
    4758  if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
    -
    4759  if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
    -
    4760  has_trans = 1;
    -
    4761  if (z->depth == 16) {
    -
    4762  for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
    -
    4763  } else {
    -
    4764  for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
    -
    4765  }
    -
    4766  }
    -
    4767  break;
    -
    4768  }
    -
    4769 
    -
    4770  case STBI__PNG_TYPE('I','D','A','T'): {
    -
    4771  if (first) return stbi__err("first not IHDR", "Corrupt PNG");
    -
    4772  if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
    -
    4773  if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
    -
    4774  if ((int)(ioff + c.length) < (int)ioff) return 0;
    -
    4775  if (ioff + c.length > idata_limit) {
    -
    4776  stbi__uint32 idata_limit_old = idata_limit;
    -
    4777  stbi_uc *p;
    -
    4778  if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
    -
    4779  while (ioff + c.length > idata_limit)
    -
    4780  idata_limit *= 2;
    -
    4781  STBI_NOTUSED(idata_limit_old);
    -
    4782  p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
    -
    4783  z->idata = p;
    -
    4784  }
    -
    4785  if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
    -
    4786  ioff += c.length;
    -
    4787  break;
    -
    4788  }
    -
    4789 
    -
    4790  case STBI__PNG_TYPE('I','E','N','D'): {
    -
    4791  stbi__uint32 raw_len, bpl;
    -
    4792  if (first) return stbi__err("first not IHDR", "Corrupt PNG");
    -
    4793  if (scan != STBI__SCAN_load) return 1;
    -
    4794  if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
    -
    4795  // initial guess for decoded data size to avoid unnecessary reallocs
    -
    4796  bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component
    -
    4797  raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
    -
    4798  z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
    -
    4799  if (z->expanded == NULL) return 0; // zlib should set error
    -
    4800  STBI_FREE(z->idata); z->idata = NULL;
    -
    4801  if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
    -
    4802  s->img_out_n = s->img_n+1;
    -
    4803  else
    -
    4804  s->img_out_n = s->img_n;
    -
    4805  if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0;
    -
    4806  if (has_trans) {
    -
    4807  if (z->depth == 16) {
    -
    4808  if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0;
    -
    4809  } else {
    -
    4810  if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
    -
    4811  }
    -
    4812  }
    -
    4813  if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
    -
    4814  stbi__de_iphone(z);
    -
    4815  if (pal_img_n) {
    -
    4816  // pal_img_n == 3 or 4
    -
    4817  s->img_n = pal_img_n; // record the actual colors we had
    -
    4818  s->img_out_n = pal_img_n;
    -
    4819  if (req_comp >= 3) s->img_out_n = req_comp;
    -
    4820  if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
    -
    4821  return 0;
    -
    4822  } else if (has_trans) {
    -
    4823  // non-paletted image with tRNS -> source image has (constant) alpha
    -
    4824  ++s->img_n;
    -
    4825  }
    -
    4826  STBI_FREE(z->expanded); z->expanded = NULL;
    -
    4827  return 1;
    -
    4828  }
    +
    4695 static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp,
    +
    4696  int parse_header)
    +
    4697 {
    +
    4698  a->zout_start = obuf;
    +
    4699  a->zout = obuf;
    +
    4700  a->zout_end = obuf + olen;
    +
    4701  a->z_expandable = exp;
    +
    4702 
    +
    4703  return stbi__parse_zlib(a, parse_header);
    +
    4704 }
    +
    4705 
    +
    4706 STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len,
    +
    4707  int initial_size, int *outlen)
    +
    4708 {
    +
    4709  stbi__zbuf a;
    +
    4710  char *p = (char *)stbi__malloc(initial_size);
    +
    4711  if (p == NULL)
    +
    4712  return NULL;
    +
    4713  a.zbuffer = (stbi_uc *)buffer;
    +
    4714  a.zbuffer_end = (stbi_uc *)buffer + len;
    +
    4715  if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {
    +
    4716  if (outlen)
    +
    4717  *outlen = (int)(a.zout - a.zout_start);
    +
    4718  return a.zout_start;
    +
    4719  } else {
    +
    4720  STBI_FREE(a.zout_start);
    +
    4721  return NULL;
    +
    4722  }
    +
    4723 }
    +
    4724 
    +
    4725 STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
    +
    4726 {
    +
    4727  return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
    +
    4728 }
    +
    4729 
    +
    4730 STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer,
    +
    4731  int len,
    +
    4732  int initial_size,
    +
    4733  int *outlen,
    +
    4734  int parse_header)
    +
    4735 {
    +
    4736  stbi__zbuf a;
    +
    4737  char *p = (char *)stbi__malloc(initial_size);
    +
    4738  if (p == NULL)
    +
    4739  return NULL;
    +
    4740  a.zbuffer = (stbi_uc *)buffer;
    +
    4741  a.zbuffer_end = (stbi_uc *)buffer + len;
    +
    4742  if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {
    +
    4743  if (outlen)
    +
    4744  *outlen = (int)(a.zout - a.zout_start);
    +
    4745  return a.zout_start;
    +
    4746  } else {
    +
    4747  STBI_FREE(a.zout_start);
    +
    4748  return NULL;
    +
    4749  }
    +
    4750 }
    +
    4751 
    +
    4752 STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen,
    +
    4753  char const *ibuffer, int ilen)
    +
    4754 {
    +
    4755  stbi__zbuf a;
    +
    4756  a.zbuffer = (stbi_uc *)ibuffer;
    +
    4757  a.zbuffer_end = (stbi_uc *)ibuffer + ilen;
    +
    4758  if (stbi__do_zlib(&a, obuffer, olen, 0, 1))
    +
    4759  return (int)(a.zout - a.zout_start);
    +
    4760  else
    +
    4761  return -1;
    +
    4762 }
    +
    4763 
    +
    4764 STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len,
    +
    4765  int *outlen)
    +
    4766 {
    +
    4767  stbi__zbuf a;
    +
    4768  char *p = (char *)stbi__malloc(16384);
    +
    4769  if (p == NULL)
    +
    4770  return NULL;
    +
    4771  a.zbuffer = (stbi_uc *)buffer;
    +
    4772  a.zbuffer_end = (stbi_uc *)buffer + len;
    +
    4773  if (stbi__do_zlib(&a, p, 16384, 1, 0)) {
    +
    4774  if (outlen)
    +
    4775  *outlen = (int)(a.zout - a.zout_start);
    +
    4776  return a.zout_start;
    +
    4777  } else {
    +
    4778  STBI_FREE(a.zout_start);
    +
    4779  return NULL;
    +
    4780  }
    +
    4781 }
    +
    4782 
    +
    4783 STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen,
    +
    4784  const char *ibuffer, int ilen)
    +
    4785 {
    +
    4786  stbi__zbuf a;
    +
    4787  a.zbuffer = (stbi_uc *)ibuffer;
    +
    4788  a.zbuffer_end = (stbi_uc *)ibuffer + ilen;
    +
    4789  if (stbi__do_zlib(&a, obuffer, olen, 0, 0))
    +
    4790  return (int)(a.zout - a.zout_start);
    +
    4791  else
    +
    4792  return -1;
    +
    4793 }
    +
    4794 #endif
    +
    4795 
    +
    4796  // public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
    +
    4797  // simple implementation
    +
    4798  // - only 8-bit samples
    +
    4799  // - no CRC checking
    +
    4800  // - allocates lots of intermediate memory
    +
    4801  // - avoids problem of streaming data between subsystems
    +
    4802  // - avoids explicit window management
    +
    4803  // performance
    +
    4804  // - uses stb_zlib, a PD zlib implementation with fast huffman decoding
    +
    4805 
    +
    4806 #ifndef STBI_NO_PNG
    +
    4807 typedef struct {
    +
    4808  stbi__uint32 length;
    +
    4809  stbi__uint32 type;
    +
    4810 } stbi__pngchunk;
    +
    4811 
    +
    4812 static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
    +
    4813 {
    +
    4814  stbi__pngchunk c;
    +
    4815  c.length = stbi__get32be(s);
    +
    4816  c.type = stbi__get32be(s);
    +
    4817  return c;
    +
    4818 }
    +
    4819 
    +
    4820 static int stbi__check_png_header(stbi__context *s)
    +
    4821 {
    +
    4822  static stbi_uc png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
    +
    4823  int i;
    +
    4824  for (i = 0; i < 8; ++i)
    +
    4825  if (stbi__get8(s) != png_sig[i])
    +
    4826  return stbi__err("bad png sig", "Not a PNG");
    +
    4827  return 1;
    +
    4828 }
    4829 
    -
    4830  default:
    -
    4831  // if critical, fail
    -
    4832  if (first) return stbi__err("first not IHDR", "Corrupt PNG");
    -
    4833  if ((c.type & (1 << 29)) == 0) {
    -
    4834  #ifndef STBI_NO_FAILURE_STRINGS
    -
    4835  // not threadsafe
    -
    4836  static char invalid_chunk[] = "XXXX PNG chunk not known";
    -
    4837  invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
    -
    4838  invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
    -
    4839  invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);
    -
    4840  invalid_chunk[3] = STBI__BYTECAST(c.type >> 0);
    -
    4841  #endif
    -
    4842  return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
    -
    4843  }
    -
    4844  stbi__skip(s, c.length);
    -
    4845  break;
    -
    4846  }
    -
    4847  // end of PNG chunk, read and skip CRC
    -
    4848  stbi__get32be(s);
    -
    4849  }
    -
    4850 }
    -
    4851 
    -
    4852 static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri)
    -
    4853 {
    -
    4854  void *result=NULL;
    -
    4855  if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
    -
    4856  if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
    -
    4857  if (p->depth < 8)
    -
    4858  ri->bits_per_channel = 8;
    -
    4859  else
    -
    4860  ri->bits_per_channel = p->depth;
    -
    4861  result = p->out;
    -
    4862  p->out = NULL;
    -
    4863  if (req_comp && req_comp != p->s->img_out_n) {
    -
    4864  if (ri->bits_per_channel == 8)
    -
    4865  result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
    -
    4866  else
    -
    4867  result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
    -
    4868  p->s->img_out_n = req_comp;
    -
    4869  if (result == NULL) return result;
    -
    4870  }
    -
    4871  *x = p->s->img_x;
    -
    4872  *y = p->s->img_y;
    -
    4873  if (n) *n = p->s->img_n;
    -
    4874  }
    -
    4875  STBI_FREE(p->out); p->out = NULL;
    -
    4876  STBI_FREE(p->expanded); p->expanded = NULL;
    -
    4877  STBI_FREE(p->idata); p->idata = NULL;
    -
    4878 
    -
    4879  return result;
    -
    4880 }
    -
    4881 
    -
    4882 static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    4883 {
    -
    4884  stbi__png p;
    -
    4885  p.s = s;
    -
    4886  return stbi__do_png(&p, x,y,comp,req_comp, ri);
    -
    4887 }
    -
    4888 
    -
    4889 static int stbi__png_test(stbi__context *s)
    -
    4890 {
    -
    4891  int r;
    -
    4892  r = stbi__check_png_header(s);
    -
    4893  stbi__rewind(s);
    -
    4894  return r;
    -
    4895 }
    -
    4896 
    -
    4897 static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
    -
    4898 {
    -
    4899  if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {
    -
    4900  stbi__rewind( p->s );
    -
    4901  return 0;
    -
    4902  }
    -
    4903  if (x) *x = p->s->img_x;
    -
    4904  if (y) *y = p->s->img_y;
    -
    4905  if (comp) *comp = p->s->img_n;
    -
    4906  return 1;
    -
    4907 }
    -
    4908 
    -
    4909 static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
    -
    4910 {
    -
    4911  stbi__png p;
    -
    4912  p.s = s;
    -
    4913  return stbi__png_info_raw(&p, x, y, comp);
    -
    4914 }
    -
    4915 #endif
    -
    4916 
    -
    4917 // Microsoft/Windows BMP image
    -
    4918 
    -
    4919 #ifndef STBI_NO_BMP
    -
    4920 static int stbi__bmp_test_raw(stbi__context *s)
    -
    4921 {
    -
    4922  int r;
    -
    4923  int sz;
    -
    4924  if (stbi__get8(s) != 'B') return 0;
    -
    4925  if (stbi__get8(s) != 'M') return 0;
    -
    4926  stbi__get32le(s); // discard filesize
    -
    4927  stbi__get16le(s); // discard reserved
    -
    4928  stbi__get16le(s); // discard reserved
    -
    4929  stbi__get32le(s); // discard data offset
    -
    4930  sz = stbi__get32le(s);
    -
    4931  r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
    -
    4932  return r;
    -
    4933 }
    -
    4934 
    -
    4935 static int stbi__bmp_test(stbi__context *s)
    -
    4936 {
    -
    4937  int r = stbi__bmp_test_raw(s);
    -
    4938  stbi__rewind(s);
    -
    4939  return r;
    -
    4940 }
    -
    4941 
    -
    4942 
    -
    4943 // returns 0..31 for the highest set bit
    -
    4944 static int stbi__high_bit(unsigned int z)
    -
    4945 {
    -
    4946  int n=0;
    -
    4947  if (z == 0) return -1;
    -
    4948  if (z >= 0x10000) n += 16, z >>= 16;
    -
    4949  if (z >= 0x00100) n += 8, z >>= 8;
    -
    4950  if (z >= 0x00010) n += 4, z >>= 4;
    -
    4951  if (z >= 0x00004) n += 2, z >>= 2;
    -
    4952  if (z >= 0x00002) n += 1, z >>= 1;
    -
    4953  return n;
    -
    4954 }
    -
    4955 
    -
    4956 static int stbi__bitcount(unsigned int a)
    -
    4957 {
    -
    4958  a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
    -
    4959  a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
    -
    4960  a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
    -
    4961  a = (a + (a >> 8)); // max 16 per 8 bits
    -
    4962  a = (a + (a >> 16)); // max 32 per 8 bits
    -
    4963  return a & 0xff;
    -
    4964 }
    -
    4965 
    -
    4966 static int stbi__shiftsigned(int v, int shift, int bits)
    -
    4967 {
    -
    4968  int result;
    -
    4969  int z=0;
    -
    4970 
    -
    4971  if (shift < 0) v <<= -shift;
    -
    4972  else v >>= shift;
    -
    4973  result = v;
    -
    4974 
    -
    4975  z = bits;
    -
    4976  while (z < 8) {
    -
    4977  result += v >> z;
    -
    4978  z += bits;
    -
    4979  }
    -
    4980  return result;
    -
    4981 }
    -
    4982 
    -
    4983 typedef struct
    -
    4984 {
    -
    4985  int bpp, offset, hsz;
    -
    4986  unsigned int mr,mg,mb,ma, all_a;
    -
    4987 } stbi__bmp_data;
    -
    4988 
    -
    4989 static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
    -
    4990 {
    -
    4991  int hsz;
    -
    4992  if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP");
    -
    4993  stbi__get32le(s); // discard filesize
    -
    4994  stbi__get16le(s); // discard reserved
    -
    4995  stbi__get16le(s); // discard reserved
    -
    4996  info->offset = stbi__get32le(s);
    -
    4997  info->hsz = hsz = stbi__get32le(s);
    -
    4998  info->mr = info->mg = info->mb = info->ma = 0;
    -
    4999 
    -
    5000  if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
    -
    5001  if (hsz == 12) {
    -
    5002  s->img_x = stbi__get16le(s);
    -
    5003  s->img_y = stbi__get16le(s);
    -
    5004  } else {
    -
    5005  s->img_x = stbi__get32le(s);
    -
    5006  s->img_y = stbi__get32le(s);
    -
    5007  }
    -
    5008  if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP");
    -
    5009  info->bpp = stbi__get16le(s);
    -
    5010  if (info->bpp == 1) return stbi__errpuc("monochrome", "BMP type not supported: 1-bit");
    -
    5011  if (hsz != 12) {
    -
    5012  int compress = stbi__get32le(s);
    -
    5013  if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
    -
    5014  stbi__get32le(s); // discard sizeof
    -
    5015  stbi__get32le(s); // discard hres
    -
    5016  stbi__get32le(s); // discard vres
    -
    5017  stbi__get32le(s); // discard colorsused
    -
    5018  stbi__get32le(s); // discard max important
    -
    5019  if (hsz == 40 || hsz == 56) {
    -
    5020  if (hsz == 56) {
    -
    5021  stbi__get32le(s);
    -
    5022  stbi__get32le(s);
    -
    5023  stbi__get32le(s);
    -
    5024  stbi__get32le(s);
    -
    5025  }
    -
    5026  if (info->bpp == 16 || info->bpp == 32) {
    -
    5027  if (compress == 0) {
    -
    5028  if (info->bpp == 32) {
    -
    5029  info->mr = 0xffu << 16;
    -
    5030  info->mg = 0xffu << 8;
    -
    5031  info->mb = 0xffu << 0;
    -
    5032  info->ma = 0xffu << 24;
    -
    5033  info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0
    -
    5034  } else {
    -
    5035  info->mr = 31u << 10;
    -
    5036  info->mg = 31u << 5;
    -
    5037  info->mb = 31u << 0;
    -
    5038  }
    -
    5039  } else if (compress == 3) {
    -
    5040  info->mr = stbi__get32le(s);
    -
    5041  info->mg = stbi__get32le(s);
    -
    5042  info->mb = stbi__get32le(s);
    -
    5043  // not documented, but generated by photoshop and handled by mspaint
    -
    5044  if (info->mr == info->mg && info->mg == info->mb) {
    -
    5045  // ?!?!?
    -
    5046  return stbi__errpuc("bad BMP", "bad BMP");
    -
    5047  }
    -
    5048  } else
    -
    5049  return stbi__errpuc("bad BMP", "bad BMP");
    -
    5050  }
    -
    5051  } else {
    -
    5052  int i;
    -
    5053  if (hsz != 108 && hsz != 124)
    -
    5054  return stbi__errpuc("bad BMP", "bad BMP");
    -
    5055  info->mr = stbi__get32le(s);
    -
    5056  info->mg = stbi__get32le(s);
    -
    5057  info->mb = stbi__get32le(s);
    -
    5058  info->ma = stbi__get32le(s);
    -
    5059  stbi__get32le(s); // discard color space
    -
    5060  for (i=0; i < 12; ++i)
    -
    5061  stbi__get32le(s); // discard color space parameters
    -
    5062  if (hsz == 124) {
    -
    5063  stbi__get32le(s); // discard rendering intent
    -
    5064  stbi__get32le(s); // discard offset of profile data
    -
    5065  stbi__get32le(s); // discard size of profile data
    -
    5066  stbi__get32le(s); // discard reserved
    -
    5067  }
    -
    5068  }
    -
    5069  }
    -
    5070  return (void *) 1;
    -
    5071 }
    -
    5072 
    -
    5073 
    -
    5074 static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    5075 {
    -
    5076  stbi_uc *out;
    -
    5077  unsigned int mr=0,mg=0,mb=0,ma=0, all_a;
    -
    5078  stbi_uc pal[256][4];
    -
    5079  int psize=0,i,j,width;
    -
    5080  int flip_vertically, pad, target;
    -
    5081  stbi__bmp_data info;
    -
    5082  STBI_NOTUSED(ri);
    -
    5083 
    -
    5084  info.all_a = 255;
    -
    5085  if (stbi__bmp_parse_header(s, &info) == NULL)
    -
    5086  return NULL; // error code already set
    -
    5087 
    -
    5088  flip_vertically = ((int) s->img_y) > 0;
    -
    5089  s->img_y = abs((int) s->img_y);
    -
    5090 
    -
    5091  mr = info.mr;
    -
    5092  mg = info.mg;
    -
    5093  mb = info.mb;
    -
    5094  ma = info.ma;
    -
    5095  all_a = info.all_a;
    -
    5096 
    -
    5097  if (info.hsz == 12) {
    -
    5098  if (info.bpp < 24)
    -
    5099  psize = (info.offset - 14 - 24) / 3;
    -
    5100  } else {
    -
    5101  if (info.bpp < 16)
    -
    5102  psize = (info.offset - 14 - info.hsz) >> 2;
    -
    5103  }
    -
    5104 
    -
    5105  s->img_n = ma ? 4 : 3;
    -
    5106  if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
    -
    5107  target = req_comp;
    -
    5108  else
    -
    5109  target = s->img_n; // if they want monochrome, we'll post-convert
    -
    5110 
    -
    5111  // sanity-check size
    -
    5112  if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0))
    -
    5113  return stbi__errpuc("too large", "Corrupt BMP");
    -
    5114 
    -
    5115  out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0);
    -
    5116  if (!out) return stbi__errpuc("outofmem", "Out of memory");
    -
    5117  if (info.bpp < 16) {
    -
    5118  int z=0;
    -
    5119  if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
    -
    5120  for (i=0; i < psize; ++i) {
    -
    5121  pal[i][2] = stbi__get8(s);
    -
    5122  pal[i][1] = stbi__get8(s);
    -
    5123  pal[i][0] = stbi__get8(s);
    -
    5124  if (info.hsz != 12) stbi__get8(s);
    -
    5125  pal[i][3] = 255;
    -
    5126  }
    -
    5127  stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4));
    -
    5128  if (info.bpp == 4) width = (s->img_x + 1) >> 1;
    -
    5129  else if (info.bpp == 8) width = s->img_x;
    -
    5130  else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
    -
    5131  pad = (-width)&3;
    -
    5132  for (j=0; j < (int) s->img_y; ++j) {
    -
    5133  for (i=0; i < (int) s->img_x; i += 2) {
    -
    5134  int v=stbi__get8(s),v2=0;
    -
    5135  if (info.bpp == 4) {
    -
    5136  v2 = v & 15;
    -
    5137  v >>= 4;
    -
    5138  }
    -
    5139  out[z++] = pal[v][0];
    -
    5140  out[z++] = pal[v][1];
    -
    5141  out[z++] = pal[v][2];
    -
    5142  if (target == 4) out[z++] = 255;
    -
    5143  if (i+1 == (int) s->img_x) break;
    -
    5144  v = (info.bpp == 8) ? stbi__get8(s) : v2;
    -
    5145  out[z++] = pal[v][0];
    -
    5146  out[z++] = pal[v][1];
    -
    5147  out[z++] = pal[v][2];
    -
    5148  if (target == 4) out[z++] = 255;
    -
    5149  }
    -
    5150  stbi__skip(s, pad);
    -
    5151  }
    -
    5152  } else {
    -
    5153  int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
    -
    5154  int z = 0;
    -
    5155  int easy=0;
    -
    5156  stbi__skip(s, info.offset - 14 - info.hsz);
    -
    5157  if (info.bpp == 24) width = 3 * s->img_x;
    -
    5158  else if (info.bpp == 16) width = 2*s->img_x;
    -
    5159  else /* bpp = 32 and pad = 0 */ width=0;
    -
    5160  pad = (-width) & 3;
    -
    5161  if (info.bpp == 24) {
    -
    5162  easy = 1;
    -
    5163  } else if (info.bpp == 32) {
    -
    5164  if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
    -
    5165  easy = 2;
    -
    5166  }
    -
    5167  if (!easy) {
    -
    5168  if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
    -
    5169  // right shift amt to put high bit in position #7
    -
    5170  rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);
    -
    5171  gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);
    -
    5172  bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);
    -
    5173  ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);
    -
    5174  }
    -
    5175  for (j=0; j < (int) s->img_y; ++j) {
    -
    5176  if (easy) {
    -
    5177  for (i=0; i < (int) s->img_x; ++i) {
    -
    5178  unsigned char a;
    -
    5179  out[z+2] = stbi__get8(s);
    -
    5180  out[z+1] = stbi__get8(s);
    -
    5181  out[z+0] = stbi__get8(s);
    -
    5182  z += 3;
    -
    5183  a = (easy == 2 ? stbi__get8(s) : 255);
    -
    5184  all_a |= a;
    -
    5185  if (target == 4) out[z++] = a;
    -
    5186  }
    -
    5187  } else {
    -
    5188  int bpp = info.bpp;
    -
    5189  for (i=0; i < (int) s->img_x; ++i) {
    -
    5190  stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s));
    -
    5191  int a;
    -
    5192  out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
    -
    5193  out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
    -
    5194  out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));
    -
    5195  a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);
    -
    5196  all_a |= a;
    -
    5197  if (target == 4) out[z++] = STBI__BYTECAST(a);
    -
    5198  }
    -
    5199  }
    -
    5200  stbi__skip(s, pad);
    -
    5201  }
    -
    5202  }
    -
    5203 
    -
    5204  // if alpha channel is all 0s, replace with all 255s
    -
    5205  if (target == 4 && all_a == 0)
    -
    5206  for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4)
    -
    5207  out[i] = 255;
    -
    5208 
    -
    5209  if (flip_vertically) {
    -
    5210  stbi_uc t;
    -
    5211  for (j=0; j < (int) s->img_y>>1; ++j) {
    -
    5212  stbi_uc *p1 = out + j *s->img_x*target;
    -
    5213  stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
    -
    5214  for (i=0; i < (int) s->img_x*target; ++i) {
    -
    5215  t = p1[i], p1[i] = p2[i], p2[i] = t;
    -
    5216  }
    -
    5217  }
    -
    5218  }
    -
    5219 
    -
    5220  if (req_comp && req_comp != target) {
    -
    5221  out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
    -
    5222  if (out == NULL) return out; // stbi__convert_format frees input on failure
    -
    5223  }
    -
    5224 
    -
    5225  *x = s->img_x;
    -
    5226  *y = s->img_y;
    -
    5227  if (comp) *comp = s->img_n;
    -
    5228  return out;
    -
    5229 }
    -
    5230 #endif
    -
    5231 
    -
    5232 // Targa Truevision - TGA
    -
    5233 // by Jonathan Dummer
    -
    5234 #ifndef STBI_NO_TGA
    -
    5235 // returns STBI_rgb or whatever, 0 on error
    -
    5236 static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16)
    +
    4830 typedef struct {
    +
    4831  stbi__context *s;
    +
    4832  stbi_uc *idata, *expanded, *out;
    +
    4833  int depth;
    +
    4834 } stbi__png;
    +
    4835 
    +
    4836 enum {
    +
    4837  STBI__F_none = 0,
    +
    4838  STBI__F_sub = 1,
    +
    4839  STBI__F_up = 2,
    +
    4840  STBI__F_avg = 3,
    +
    4841  STBI__F_paeth = 4,
    +
    4842  // synthetic filters used for first scanline to avoid needing a dummy row of
    +
    4843  // 0s
    +
    4844  STBI__F_avg_first,
    +
    4845  STBI__F_paeth_first
    +
    4846 };
    +
    4847 
    +
    4848 static stbi_uc first_row_filter[5] = {STBI__F_none, STBI__F_sub, STBI__F_none,
    +
    4849  STBI__F_avg_first, STBI__F_paeth_first};
    +
    4850 
    +
    4851 static int stbi__paeth(int a, int b, int c)
    +
    4852 {
    +
    4853  int p = a + b - c;
    +
    4854  int pa = abs(p - a);
    +
    4855  int pb = abs(p - b);
    +
    4856  int pc = abs(p - c);
    +
    4857  if (pa <= pb && pa <= pc)
    +
    4858  return a;
    +
    4859  if (pb <= pc)
    +
    4860  return b;
    +
    4861  return c;
    +
    4862 }
    +
    4863 
    +
    4864 static stbi_uc stbi__depth_scale_table[9] = {0, 0xff, 0x55, 0, 0x11,
    +
    4865  0, 0, 0, 0x01};
    +
    4866 
    +
    4867 // create the png data from post-deflated data
    +
    4868 static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw,
    +
    4869  stbi__uint32 raw_len, int out_n,
    +
    4870  stbi__uint32 x, stbi__uint32 y, int depth,
    +
    4871  int color)
    +
    4872 {
    +
    4873  int bytes = (depth == 16 ? 2 : 1);
    +
    4874  stbi__context *s = a->s;
    +
    4875  stbi__uint32 i, j, stride = x * out_n * bytes;
    +
    4876  stbi__uint32 img_len, img_width_bytes;
    +
    4877  int k;
    +
    4878  int img_n = s->img_n; // copy it into a local for later
    +
    4879 
    +
    4880  int output_bytes = out_n * bytes;
    +
    4881  int filter_bytes = img_n * bytes;
    +
    4882  int width = x;
    +
    4883 
    +
    4884  STBI_ASSERT(out_n == s->img_n || out_n == s->img_n + 1);
    +
    4885  a->out = (stbi_uc *)stbi__malloc_mad3(
    +
    4886  x, y, output_bytes, 0); // extra bytes to write off the end into
    +
    4887  if (!a->out)
    +
    4888  return stbi__err("outofmem", "Out of memory");
    +
    4889 
    +
    4890  img_width_bytes = (((img_n * x * depth) + 7) >> 3);
    +
    4891  img_len = (img_width_bytes + 1) * y;
    +
    4892  // we used to check for exact match between raw_len and img_len on
    +
    4893  // non-interlaced PNGs, but issue #276 reported a PNG in the wild that had
    +
    4894  // extra data at the end (all zeros), so just check for raw_len < img_len
    +
    4895  // always.
    +
    4896  if (raw_len < img_len)
    +
    4897  return stbi__err("not enough pixels", "Corrupt PNG");
    +
    4898 
    +
    4899  for (j = 0; j < y; ++j) {
    +
    4900  stbi_uc *cur = a->out + stride * j;
    +
    4901  stbi_uc *prior;
    +
    4902  int filter = *raw++;
    +
    4903 
    +
    4904  if (filter > 4)
    +
    4905  return stbi__err("invalid filter", "Corrupt PNG");
    +
    4906 
    +
    4907  if (depth < 8) {
    +
    4908  STBI_ASSERT(img_width_bytes <= x);
    +
    4909  cur += x * out_n - img_width_bytes; // store output to the rightmost
    +
    4910  // img_len bytes, so we can
    +
    4911  // decode in place
    +
    4912  filter_bytes = 1;
    +
    4913  width = img_width_bytes;
    +
    4914  }
    +
    4915  prior = cur - stride; // bugfix: need to compute this after 'cur +='
    +
    4916  // computation above
    +
    4917 
    +
    4918  // if first row, use special filter that doesn't sample previous row
    +
    4919  if (j == 0)
    +
    4920  filter = first_row_filter[filter];
    +
    4921 
    +
    4922  // handle first byte explicitly
    +
    4923  for (k = 0; k < filter_bytes; ++k) {
    +
    4924  switch (filter) {
    +
    4925  case STBI__F_none:
    +
    4926  cur[k] = raw[k];
    +
    4927  break;
    +
    4928  case STBI__F_sub:
    +
    4929  cur[k] = raw[k];
    +
    4930  break;
    +
    4931  case STBI__F_up:
    +
    4932  cur[k] = STBI__BYTECAST(raw[k] + prior[k]);
    +
    4933  break;
    +
    4934  case STBI__F_avg:
    +
    4935  cur[k] = STBI__BYTECAST(raw[k] + (prior[k] >> 1));
    +
    4936  break;
    +
    4937  case STBI__F_paeth:
    +
    4938  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0, prior[k], 0));
    +
    4939  break;
    +
    4940  case STBI__F_avg_first:
    +
    4941  cur[k] = raw[k];
    +
    4942  break;
    +
    4943  case STBI__F_paeth_first:
    +
    4944  cur[k] = raw[k];
    +
    4945  break;
    +
    4946  }
    +
    4947  }
    +
    4948 
    +
    4949  if (depth == 8) {
    +
    4950  if (img_n != out_n)
    +
    4951  cur[img_n] = 255; // first pixel
    +
    4952  raw += img_n;
    +
    4953  cur += out_n;
    +
    4954  prior += out_n;
    +
    4955  } else if (depth == 16) {
    +
    4956  if (img_n != out_n) {
    +
    4957  cur[filter_bytes] = 255; // first pixel top byte
    +
    4958  cur[filter_bytes + 1] = 255; // first pixel bottom byte
    +
    4959  }
    +
    4960  raw += filter_bytes;
    +
    4961  cur += output_bytes;
    +
    4962  prior += output_bytes;
    +
    4963  } else {
    +
    4964  raw += 1;
    +
    4965  cur += 1;
    +
    4966  prior += 1;
    +
    4967  }
    +
    4968 
    +
    4969  // this is a little gross, so that we don't switch per-pixel or
    +
    4970  // per-component
    +
    4971  if (depth < 8 || img_n == out_n) {
    +
    4972  int nk = (width - 1) * filter_bytes;
    +
    4973 #define STBI__CASE(f) \
    +
    4974  case f: \
    +
    4975  for (k = 0; k < nk; ++k)
    +
    4976  switch (filter) {
    +
    4977  // "none" filter turns into a memcpy here; make that explicit.
    +
    4978  case STBI__F_none:
    +
    4979  memcpy(cur, raw, nk);
    +
    4980  break;
    +
    4981  STBI__CASE(STBI__F_sub)
    +
    4982  {
    +
    4983  cur[k] = STBI__BYTECAST(raw[k] + cur[k - filter_bytes]);
    +
    4984  }
    +
    4985  break;
    +
    4986  STBI__CASE(STBI__F_up)
    +
    4987  {
    +
    4988  cur[k] = STBI__BYTECAST(raw[k] + prior[k]);
    +
    4989  }
    +
    4990  break;
    +
    4991  STBI__CASE(STBI__F_avg)
    +
    4992  {
    +
    4993  cur[k] = STBI__BYTECAST(
    +
    4994  raw[k] + ((prior[k] + cur[k - filter_bytes]) >> 1));
    +
    4995  }
    +
    4996  break;
    +
    4997  STBI__CASE(STBI__F_paeth)
    +
    4998  {
    +
    4999  cur[k] = STBI__BYTECAST(
    +
    5000  raw[k] + stbi__paeth(cur[k - filter_bytes], prior[k],
    +
    5001  prior[k - filter_bytes]));
    +
    5002  }
    +
    5003  break;
    +
    5004  STBI__CASE(STBI__F_avg_first)
    +
    5005  {
    +
    5006  cur[k] =
    +
    5007  STBI__BYTECAST(raw[k] + (cur[k - filter_bytes] >> 1));
    +
    5008  }
    +
    5009  break;
    +
    5010  STBI__CASE(STBI__F_paeth_first)
    +
    5011  {
    +
    5012  cur[k] = STBI__BYTECAST(
    +
    5013  raw[k] + stbi__paeth(cur[k - filter_bytes], 0, 0));
    +
    5014  }
    +
    5015  break;
    +
    5016  }
    +
    5017 #undef STBI__CASE
    +
    5018  raw += nk;
    +
    5019  } else {
    +
    5020  STBI_ASSERT(img_n + 1 == out_n);
    +
    5021 #define STBI__CASE(f) \
    +
    5022  case f: \
    +
    5023  for (i = x - 1; i >= 1; --i, cur[filter_bytes] = 255, \
    +
    5024  raw += filter_bytes, cur += output_bytes, prior += output_bytes) \
    +
    5025  for (k = 0; k < filter_bytes; ++k)
    +
    5026  switch (filter) {
    +
    5027  STBI__CASE(STBI__F_none) { cur[k] = raw[k]; }
    +
    5028  break;
    +
    5029  STBI__CASE(STBI__F_sub)
    +
    5030  {
    +
    5031  cur[k] = STBI__BYTECAST(raw[k] + cur[k - output_bytes]);
    +
    5032  }
    +
    5033  break;
    +
    5034  STBI__CASE(STBI__F_up)
    +
    5035  {
    +
    5036  cur[k] = STBI__BYTECAST(raw[k] + prior[k]);
    +
    5037  }
    +
    5038  break;
    +
    5039  STBI__CASE(STBI__F_avg)
    +
    5040  {
    +
    5041  cur[k] = STBI__BYTECAST(
    +
    5042  raw[k] + ((prior[k] + cur[k - output_bytes]) >> 1));
    +
    5043  }
    +
    5044  break;
    +
    5045  STBI__CASE(STBI__F_paeth)
    +
    5046  {
    +
    5047  cur[k] = STBI__BYTECAST(
    +
    5048  raw[k] + stbi__paeth(cur[k - output_bytes], prior[k],
    +
    5049  prior[k - output_bytes]));
    +
    5050  }
    +
    5051  break;
    +
    5052  STBI__CASE(STBI__F_avg_first)
    +
    5053  {
    +
    5054  cur[k] =
    +
    5055  STBI__BYTECAST(raw[k] + (cur[k - output_bytes] >> 1));
    +
    5056  }
    +
    5057  break;
    +
    5058  STBI__CASE(STBI__F_paeth_first)
    +
    5059  {
    +
    5060  cur[k] = STBI__BYTECAST(
    +
    5061  raw[k] + stbi__paeth(cur[k - output_bytes], 0, 0));
    +
    5062  }
    +
    5063  break;
    +
    5064  }
    +
    5065 #undef STBI__CASE
    +
    5066 
    +
    5067  // the loop above sets the high byte of the pixels' alpha, but for
    +
    5068  // 16 bit png files we also need the low byte set. we'll do that
    +
    5069  // here.
    +
    5070  if (depth == 16) {
    +
    5071  cur = a->out +
    +
    5072  stride * j; // start at the beginning of the row again
    +
    5073  for (i = 0; i < x; ++i, cur += output_bytes) {
    +
    5074  cur[filter_bytes + 1] = 255;
    +
    5075  }
    +
    5076  }
    +
    5077  }
    +
    5078  }
    +
    5079 
    +
    5080  // we make a separate pass to expand bits to pixels; for performance,
    +
    5081  // this could run two scanlines behind the above code, so it won't
    +
    5082  // intefere with filtering but will still be in the cache.
    +
    5083  if (depth < 8) {
    +
    5084  for (j = 0; j < y; ++j) {
    +
    5085  stbi_uc *cur = a->out + stride * j;
    +
    5086  stbi_uc *in = a->out + stride * j + x * out_n - img_width_bytes;
    +
    5087  // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the
    +
    5088  // common 8-bit path optimal at minimal cost for 1/2/4-bit png
    +
    5089  // guarante byte alignment, if width is not multiple of 8/4/2 we'll
    +
    5090  // decode dummy trailing data that will be skipped in the later loop
    +
    5091  stbi_uc scale = (color == 0)
    +
    5092  ? stbi__depth_scale_table[depth]
    +
    5093  : 1; // scale grayscale values to 0..255 range
    +
    5094 
    +
    5095  // note that the final byte might overshoot and write more data than
    +
    5096  // desired. we can allocate enough data that this never writes out
    +
    5097  // of memory, but it could also overwrite the next scanline. can it
    +
    5098  // overwrite non-empty data on the next scanline? yes, consider
    +
    5099  // 1-pixel-wide scanlines with 1-bit-per-pixel. so we need to
    +
    5100  // explicitly clamp the final ones
    +
    5101 
    +
    5102  if (depth == 4) {
    +
    5103  for (k = x * img_n; k >= 2; k -= 2, ++in) {
    +
    5104  *cur++ = scale * ((*in >> 4));
    +
    5105  *cur++ = scale * ((*in) & 0x0f);
    +
    5106  }
    +
    5107  if (k > 0)
    +
    5108  *cur++ = scale * ((*in >> 4));
    +
    5109  } else if (depth == 2) {
    +
    5110  for (k = x * img_n; k >= 4; k -= 4, ++in) {
    +
    5111  *cur++ = scale * ((*in >> 6));
    +
    5112  *cur++ = scale * ((*in >> 4) & 0x03);
    +
    5113  *cur++ = scale * ((*in >> 2) & 0x03);
    +
    5114  *cur++ = scale * ((*in) & 0x03);
    +
    5115  }
    +
    5116  if (k > 0)
    +
    5117  *cur++ = scale * ((*in >> 6));
    +
    5118  if (k > 1)
    +
    5119  *cur++ = scale * ((*in >> 4) & 0x03);
    +
    5120  if (k > 2)
    +
    5121  *cur++ = scale * ((*in >> 2) & 0x03);
    +
    5122  } else if (depth == 1) {
    +
    5123  for (k = x * img_n; k >= 8; k -= 8, ++in) {
    +
    5124  *cur++ = scale * ((*in >> 7));
    +
    5125  *cur++ = scale * ((*in >> 6) & 0x01);
    +
    5126  *cur++ = scale * ((*in >> 5) & 0x01);
    +
    5127  *cur++ = scale * ((*in >> 4) & 0x01);
    +
    5128  *cur++ = scale * ((*in >> 3) & 0x01);
    +
    5129  *cur++ = scale * ((*in >> 2) & 0x01);
    +
    5130  *cur++ = scale * ((*in >> 1) & 0x01);
    +
    5131  *cur++ = scale * ((*in) & 0x01);
    +
    5132  }
    +
    5133  if (k > 0)
    +
    5134  *cur++ = scale * ((*in >> 7));
    +
    5135  if (k > 1)
    +
    5136  *cur++ = scale * ((*in >> 6) & 0x01);
    +
    5137  if (k > 2)
    +
    5138  *cur++ = scale * ((*in >> 5) & 0x01);
    +
    5139  if (k > 3)
    +
    5140  *cur++ = scale * ((*in >> 4) & 0x01);
    +
    5141  if (k > 4)
    +
    5142  *cur++ = scale * ((*in >> 3) & 0x01);
    +
    5143  if (k > 5)
    +
    5144  *cur++ = scale * ((*in >> 2) & 0x01);
    +
    5145  if (k > 6)
    +
    5146  *cur++ = scale * ((*in >> 1) & 0x01);
    +
    5147  }
    +
    5148  if (img_n != out_n) {
    +
    5149  int q;
    +
    5150  // insert alpha = 255
    +
    5151  cur = a->out + stride * j;
    +
    5152  if (img_n == 1) {
    +
    5153  for (q = x - 1; q >= 0; --q) {
    +
    5154  cur[q * 2 + 1] = 255;
    +
    5155  cur[q * 2 + 0] = cur[q];
    +
    5156  }
    +
    5157  } else {
    +
    5158  STBI_ASSERT(img_n == 3);
    +
    5159  for (q = x - 1; q >= 0; --q) {
    +
    5160  cur[q * 4 + 3] = 255;
    +
    5161  cur[q * 4 + 2] = cur[q * 3 + 2];
    +
    5162  cur[q * 4 + 1] = cur[q * 3 + 1];
    +
    5163  cur[q * 4 + 0] = cur[q * 3 + 0];
    +
    5164  }
    +
    5165  }
    +
    5166  }
    +
    5167  }
    +
    5168  } else if (depth == 16) {
    +
    5169  // force the image data from big-endian to platform-native.
    +
    5170  // this is done in a separate pass due to the decoding relying
    +
    5171  // on the data being untouched, but could probably be done
    +
    5172  // per-line during decode if care is taken.
    +
    5173  stbi_uc *cur = a->out;
    +
    5174  stbi__uint16 *cur16 = (stbi__uint16 *)cur;
    +
    5175 
    +
    5176  for (i = 0; i < x * y * out_n; ++i, cur16++, cur += 2) {
    +
    5177  *cur16 = (cur[0] << 8) | cur[1];
    +
    5178  }
    +
    5179  }
    +
    5180 
    +
    5181  return 1;
    +
    5182 }
    +
    5183 
    +
    5184 static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data,
    +
    5185  stbi__uint32 image_data_len, int out_n,
    +
    5186  int depth, int color, int interlaced)
    +
    5187 {
    +
    5188  int bytes = (depth == 16 ? 2 : 1);
    +
    5189  int out_bytes = out_n * bytes;
    +
    5190  stbi_uc *final;
    +
    5191  int p;
    +
    5192  if (!interlaced)
    +
    5193  return stbi__create_png_image_raw(a, image_data, image_data_len, out_n,
    +
    5194  a->s->img_x, a->s->img_y, depth,
    +
    5195  color);
    +
    5196 
    +
    5197  // de-interlacing
    +
    5198  final =
    +
    5199  (stbi_uc *)stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);
    +
    5200  for (p = 0; p < 7; ++p) {
    +
    5201  int xorig[] = {0, 4, 0, 2, 0, 1, 0};
    +
    5202  int yorig[] = {0, 0, 4, 0, 2, 0, 1};
    +
    5203  int xspc[] = {8, 8, 4, 4, 2, 2, 1};
    +
    5204  int yspc[] = {8, 8, 8, 4, 4, 2, 2};
    +
    5205  int i, j, x, y;
    +
    5206  // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
    +
    5207  x = (a->s->img_x - xorig[p] + xspc[p] - 1) / xspc[p];
    +
    5208  y = (a->s->img_y - yorig[p] + yspc[p] - 1) / yspc[p];
    +
    5209  if (x && y) {
    +
    5210  stbi__uint32 img_len =
    +
    5211  ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
    +
    5212  if (!stbi__create_png_image_raw(a, image_data, image_data_len,
    +
    5213  out_n, x, y, depth, color)) {
    +
    5214  STBI_FREE(final);
    +
    5215  return 0;
    +
    5216  }
    +
    5217  for (j = 0; j < y; ++j) {
    +
    5218  for (i = 0; i < x; ++i) {
    +
    5219  int out_y = j * yspc[p] + yorig[p];
    +
    5220  int out_x = i * xspc[p] + xorig[p];
    +
    5221  memcpy(final + out_y * a->s->img_x * out_bytes +
    +
    5222  out_x * out_bytes,
    +
    5223  a->out + (j * x + i) * out_bytes, out_bytes);
    +
    5224  }
    +
    5225  }
    +
    5226  STBI_FREE(a->out);
    +
    5227  image_data += img_len;
    +
    5228  image_data_len -= img_len;
    +
    5229  }
    +
    5230  }
    +
    5231  a->out = final;
    +
    5232 
    +
    5233  return 1;
    +
    5234 }
    +
    5235 
    +
    5236 static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
    5237 {
    -
    5238  // only RGB or RGBA (incl. 16bit) or grey allowed
    -
    5239  if(is_rgb16) *is_rgb16 = 0;
    -
    5240  switch(bits_per_pixel) {
    -
    5241  case 8: return STBI_grey;
    -
    5242  case 16: if(is_grey) return STBI_grey_alpha;
    -
    5243  // else: fall-through
    -
    5244  case 15: if(is_rgb16) *is_rgb16 = 1;
    -
    5245  return STBI_rgb;
    -
    5246  case 24: // fall-through
    -
    5247  case 32: return bits_per_pixel/8;
    -
    5248  default: return 0;
    -
    5249  }
    -
    5250 }
    -
    5251 
    -
    5252 static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
    -
    5253 {
    -
    5254  int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp;
    -
    5255  int sz, tga_colormap_type;
    -
    5256  stbi__get8(s); // discard Offset
    -
    5257  tga_colormap_type = stbi__get8(s); // colormap type
    -
    5258  if( tga_colormap_type > 1 ) {
    -
    5259  stbi__rewind(s);
    -
    5260  return 0; // only RGB or indexed allowed
    -
    5261  }
    -
    5262  tga_image_type = stbi__get8(s); // image type
    -
    5263  if ( tga_colormap_type == 1 ) { // colormapped (paletted) image
    -
    5264  if (tga_image_type != 1 && tga_image_type != 9) {
    -
    5265  stbi__rewind(s);
    -
    5266  return 0;
    -
    5267  }
    -
    5268  stbi__skip(s,4); // skip index of first colormap entry and number of entries
    -
    5269  sz = stbi__get8(s); // check bits per palette color entry
    -
    5270  if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) {
    -
    5271  stbi__rewind(s);
    -
    5272  return 0;
    -
    5273  }
    -
    5274  stbi__skip(s,4); // skip image x and y origin
    -
    5275  tga_colormap_bpp = sz;
    -
    5276  } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE
    -
    5277  if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) {
    -
    5278  stbi__rewind(s);
    -
    5279  return 0; // only RGB or grey allowed, +/- RLE
    -
    5280  }
    -
    5281  stbi__skip(s,9); // skip colormap specification and image x/y origin
    -
    5282  tga_colormap_bpp = 0;
    +
    5238  stbi__context *s = z->s;
    +
    5239  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    +
    5240  stbi_uc *p = z->out;
    +
    5241 
    +
    5242  // compute color-based transparency, assuming we've
    +
    5243  // already got 255 as the alpha value in the output
    +
    5244  STBI_ASSERT(out_n == 2 || out_n == 4);
    +
    5245 
    +
    5246  if (out_n == 2) {
    +
    5247  for (i = 0; i < pixel_count; ++i) {
    +
    5248  p[1] = (p[0] == tc[0] ? 0 : 255);
    +
    5249  p += 2;
    +
    5250  }
    +
    5251  } else {
    +
    5252  for (i = 0; i < pixel_count; ++i) {
    +
    5253  if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
    +
    5254  p[3] = 0;
    +
    5255  p += 4;
    +
    5256  }
    +
    5257  }
    +
    5258  return 1;
    +
    5259 }
    +
    5260 
    +
    5261 static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3],
    +
    5262  int out_n)
    +
    5263 {
    +
    5264  stbi__context *s = z->s;
    +
    5265  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    +
    5266  stbi__uint16 *p = (stbi__uint16 *)z->out;
    +
    5267 
    +
    5268  // compute color-based transparency, assuming we've
    +
    5269  // already got 65535 as the alpha value in the output
    +
    5270  STBI_ASSERT(out_n == 2 || out_n == 4);
    +
    5271 
    +
    5272  if (out_n == 2) {
    +
    5273  for (i = 0; i < pixel_count; ++i) {
    +
    5274  p[1] = (p[0] == tc[0] ? 0 : 65535);
    +
    5275  p += 2;
    +
    5276  }
    +
    5277  } else {
    +
    5278  for (i = 0; i < pixel_count; ++i) {
    +
    5279  if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
    +
    5280  p[3] = 0;
    +
    5281  p += 4;
    +
    5282  }
    5283  }
    -
    5284  tga_w = stbi__get16le(s);
    -
    5285  if( tga_w < 1 ) {
    -
    5286  stbi__rewind(s);
    -
    5287  return 0; // test width
    -
    5288  }
    -
    5289  tga_h = stbi__get16le(s);
    -
    5290  if( tga_h < 1 ) {
    -
    5291  stbi__rewind(s);
    -
    5292  return 0; // test height
    -
    5293  }
    -
    5294  tga_bits_per_pixel = stbi__get8(s); // bits per pixel
    -
    5295  stbi__get8(s); // ignore alpha bits
    -
    5296  if (tga_colormap_bpp != 0) {
    -
    5297  if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) {
    -
    5298  // when using a colormap, tga_bits_per_pixel is the size of the indexes
    -
    5299  // I don't think anything but 8 or 16bit indexes makes sense
    -
    5300  stbi__rewind(s);
    -
    5301  return 0;
    -
    5302  }
    -
    5303  tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL);
    -
    5304  } else {
    -
    5305  tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL);
    -
    5306  }
    -
    5307  if(!tga_comp) {
    -
    5308  stbi__rewind(s);
    -
    5309  return 0;
    -
    5310  }
    -
    5311  if (x) *x = tga_w;
    -
    5312  if (y) *y = tga_h;
    -
    5313  if (comp) *comp = tga_comp;
    -
    5314  return 1; // seems to have passed everything
    -
    5315 }
    -
    5316 
    -
    5317 static int stbi__tga_test(stbi__context *s)
    -
    5318 {
    -
    5319  int res = 0;
    -
    5320  int sz, tga_color_type;
    -
    5321  stbi__get8(s); // discard Offset
    -
    5322  tga_color_type = stbi__get8(s); // color type
    -
    5323  if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed
    -
    5324  sz = stbi__get8(s); // image type
    -
    5325  if ( tga_color_type == 1 ) { // colormapped (paletted) image
    -
    5326  if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9
    -
    5327  stbi__skip(s,4); // skip index of first colormap entry and number of entries
    -
    5328  sz = stbi__get8(s); // check bits per palette color entry
    -
    5329  if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
    -
    5330  stbi__skip(s,4); // skip image x and y origin
    -
    5331  } else { // "normal" image w/o colormap
    -
    5332  if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE
    -
    5333  stbi__skip(s,9); // skip colormap specification and image x/y origin
    -
    5334  }
    -
    5335  if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width
    -
    5336  if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height
    -
    5337  sz = stbi__get8(s); // bits per pixel
    -
    5338  if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index
    -
    5339  if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
    -
    5340 
    -
    5341  res = 1; // if we got this far, everything's good and we can return 1 instead of 0
    -
    5342 
    -
    5343 errorEnd:
    -
    5344  stbi__rewind(s);
    -
    5345  return res;
    -
    5346 }
    -
    5347 
    -
    5348 // read 16bit value and convert to 24bit RGB
    -
    5349 static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)
    -
    5350 {
    -
    5351  stbi__uint16 px = (stbi__uint16)stbi__get16le(s);
    -
    5352  stbi__uint16 fiveBitMask = 31;
    -
    5353  // we have 3 channels with 5bits each
    -
    5354  int r = (px >> 10) & fiveBitMask;
    -
    5355  int g = (px >> 5) & fiveBitMask;
    -
    5356  int b = px & fiveBitMask;
    -
    5357  // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later
    -
    5358  out[0] = (stbi_uc)((r * 255)/31);
    -
    5359  out[1] = (stbi_uc)((g * 255)/31);
    -
    5360  out[2] = (stbi_uc)((b * 255)/31);
    -
    5361 
    -
    5362  // some people claim that the most significant bit might be used for alpha
    -
    5363  // (possibly if an alpha-bit is set in the "image descriptor byte")
    -
    5364  // but that only made 16bit test images completely translucent..
    -
    5365  // so let's treat all 15 and 16bit TGAs as RGB with no alpha.
    -
    5366 }
    -
    5367 
    -
    5368 static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    5369 {
    -
    5370  // read in the TGA header stuff
    -
    5371  int tga_offset = stbi__get8(s);
    -
    5372  int tga_indexed = stbi__get8(s);
    -
    5373  int tga_image_type = stbi__get8(s);
    -
    5374  int tga_is_RLE = 0;
    -
    5375  int tga_palette_start = stbi__get16le(s);
    -
    5376  int tga_palette_len = stbi__get16le(s);
    -
    5377  int tga_palette_bits = stbi__get8(s);
    -
    5378  int tga_x_origin = stbi__get16le(s);
    -
    5379  int tga_y_origin = stbi__get16le(s);
    -
    5380  int tga_width = stbi__get16le(s);
    -
    5381  int tga_height = stbi__get16le(s);
    -
    5382  int tga_bits_per_pixel = stbi__get8(s);
    -
    5383  int tga_comp, tga_rgb16=0;
    -
    5384  int tga_inverted = stbi__get8(s);
    -
    5385  // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?)
    -
    5386  // image data
    -
    5387  unsigned char *tga_data;
    -
    5388  unsigned char *tga_palette = NULL;
    -
    5389  int i, j;
    -
    5390  unsigned char raw_data[4] = {0};
    -
    5391  int RLE_count = 0;
    -
    5392  int RLE_repeating = 0;
    -
    5393  int read_next_pixel = 1;
    -
    5394  STBI_NOTUSED(ri);
    -
    5395 
    -
    5396  // do a tiny bit of precessing
    -
    5397  if ( tga_image_type >= 8 )
    -
    5398  {
    -
    5399  tga_image_type -= 8;
    -
    5400  tga_is_RLE = 1;
    -
    5401  }
    -
    5402  tga_inverted = 1 - ((tga_inverted >> 5) & 1);
    -
    5403 
    -
    5404  // If I'm paletted, then I'll use the number of bits from the palette
    -
    5405  if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);
    -
    5406  else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16);
    -
    5407 
    -
    5408  if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency
    -
    5409  return stbi__errpuc("bad format", "Can't find out TGA pixelformat");
    -
    5410 
    -
    5411  // tga info
    -
    5412  *x = tga_width;
    -
    5413  *y = tga_height;
    -
    5414  if (comp) *comp = tga_comp;
    -
    5415 
    -
    5416  if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0))
    -
    5417  return stbi__errpuc("too large", "Corrupt TGA");
    -
    5418 
    -
    5419  tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0);
    -
    5420  if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");
    -
    5421 
    -
    5422  // skip to the data's starting position (offset usually = 0)
    -
    5423  stbi__skip(s, tga_offset );
    -
    5424 
    -
    5425  if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) {
    -
    5426  for (i=0; i < tga_height; ++i) {
    -
    5427  int row = tga_inverted ? tga_height -i - 1 : i;
    -
    5428  stbi_uc *tga_row = tga_data + row*tga_width*tga_comp;
    -
    5429  stbi__getn(s, tga_row, tga_width * tga_comp);
    -
    5430  }
    -
    5431  } else {
    -
    5432  // do I need to load a palette?
    -
    5433  if ( tga_indexed)
    -
    5434  {
    -
    5435  // any data to skip? (offset usually = 0)
    -
    5436  stbi__skip(s, tga_palette_start );
    -
    5437  // load the palette
    -
    5438  tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0);
    -
    5439  if (!tga_palette) {
    -
    5440  STBI_FREE(tga_data);
    -
    5441  return stbi__errpuc("outofmem", "Out of memory");
    -
    5442  }
    -
    5443  if (tga_rgb16) {
    -
    5444  stbi_uc *pal_entry = tga_palette;
    -
    5445  STBI_ASSERT(tga_comp == STBI_rgb);
    -
    5446  for (i=0; i < tga_palette_len; ++i) {
    -
    5447  stbi__tga_read_rgb16(s, pal_entry);
    -
    5448  pal_entry += tga_comp;
    -
    5449  }
    -
    5450  } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) {
    -
    5451  STBI_FREE(tga_data);
    -
    5452  STBI_FREE(tga_palette);
    -
    5453  return stbi__errpuc("bad palette", "Corrupt TGA");
    -
    5454  }
    -
    5455  }
    -
    5456  // load the data
    -
    5457  for (i=0; i < tga_width * tga_height; ++i)
    -
    5458  {
    -
    5459  // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
    -
    5460  if ( tga_is_RLE )
    -
    5461  {
    -
    5462  if ( RLE_count == 0 )
    -
    5463  {
    -
    5464  // yep, get the next byte as a RLE command
    -
    5465  int RLE_cmd = stbi__get8(s);
    -
    5466  RLE_count = 1 + (RLE_cmd & 127);
    -
    5467  RLE_repeating = RLE_cmd >> 7;
    -
    5468  read_next_pixel = 1;
    -
    5469  } else if ( !RLE_repeating )
    -
    5470  {
    -
    5471  read_next_pixel = 1;
    -
    5472  }
    -
    5473  } else
    -
    5474  {
    -
    5475  read_next_pixel = 1;
    -
    5476  }
    -
    5477  // OK, if I need to read a pixel, do it now
    -
    5478  if ( read_next_pixel )
    -
    5479  {
    -
    5480  // load however much data we did have
    -
    5481  if ( tga_indexed )
    -
    5482  {
    -
    5483  // read in index, then perform the lookup
    -
    5484  int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s);
    -
    5485  if ( pal_idx >= tga_palette_len ) {
    -
    5486  // invalid index
    -
    5487  pal_idx = 0;
    -
    5488  }
    -
    5489  pal_idx *= tga_comp;
    -
    5490  for (j = 0; j < tga_comp; ++j) {
    -
    5491  raw_data[j] = tga_palette[pal_idx+j];
    -
    5492  }
    -
    5493  } else if(tga_rgb16) {
    -
    5494  STBI_ASSERT(tga_comp == STBI_rgb);
    -
    5495  stbi__tga_read_rgb16(s, raw_data);
    -
    5496  } else {
    -
    5497  // read in the data raw
    -
    5498  for (j = 0; j < tga_comp; ++j) {
    -
    5499  raw_data[j] = stbi__get8(s);
    -
    5500  }
    -
    5501  }
    -
    5502  // clear the reading flag for the next pixel
    -
    5503  read_next_pixel = 0;
    -
    5504  } // end of reading a pixel
    -
    5505 
    -
    5506  // copy data
    -
    5507  for (j = 0; j < tga_comp; ++j)
    -
    5508  tga_data[i*tga_comp+j] = raw_data[j];
    -
    5509 
    -
    5510  // in case we're in RLE mode, keep counting down
    -
    5511  --RLE_count;
    -
    5512  }
    -
    5513  // do I need to invert the image?
    -
    5514  if ( tga_inverted )
    -
    5515  {
    -
    5516  for (j = 0; j*2 < tga_height; ++j)
    -
    5517  {
    -
    5518  int index1 = j * tga_width * tga_comp;
    -
    5519  int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
    -
    5520  for (i = tga_width * tga_comp; i > 0; --i)
    -
    5521  {
    -
    5522  unsigned char temp = tga_data[index1];
    -
    5523  tga_data[index1] = tga_data[index2];
    -
    5524  tga_data[index2] = temp;
    -
    5525  ++index1;
    -
    5526  ++index2;
    -
    5527  }
    -
    5528  }
    -
    5529  }
    -
    5530  // clear my palette, if I had one
    -
    5531  if ( tga_palette != NULL )
    -
    5532  {
    -
    5533  STBI_FREE( tga_palette );
    -
    5534  }
    -
    5535  }
    -
    5536 
    -
    5537  // swap RGB - if the source data was RGB16, it already is in the right order
    -
    5538  if (tga_comp >= 3 && !tga_rgb16)
    -
    5539  {
    -
    5540  unsigned char* tga_pixel = tga_data;
    -
    5541  for (i=0; i < tga_width * tga_height; ++i)
    -
    5542  {
    -
    5543  unsigned char temp = tga_pixel[0];
    -
    5544  tga_pixel[0] = tga_pixel[2];
    -
    5545  tga_pixel[2] = temp;
    -
    5546  tga_pixel += tga_comp;
    -
    5547  }
    -
    5548  }
    -
    5549 
    -
    5550  // convert to target component count
    -
    5551  if (req_comp && req_comp != tga_comp)
    -
    5552  tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);
    +
    5284  return 1;
    +
    5285 }
    +
    5286 
    +
    5287 static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len,
    +
    5288  int pal_img_n)
    +
    5289 {
    +
    5290  stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
    +
    5291  stbi_uc *p, *temp_out, *orig = a->out;
    +
    5292 
    +
    5293  p = (stbi_uc *)stbi__malloc_mad2(pixel_count, pal_img_n, 0);
    +
    5294  if (p == NULL)
    +
    5295  return stbi__err("outofmem", "Out of memory");
    +
    5296 
    +
    5297  // between here and free(out) below, exitting would leak
    +
    5298  temp_out = p;
    +
    5299 
    +
    5300  if (pal_img_n == 3) {
    +
    5301  for (i = 0; i < pixel_count; ++i) {
    +
    5302  int n = orig[i] * 4;
    +
    5303  p[0] = palette[n];
    +
    5304  p[1] = palette[n + 1];
    +
    5305  p[2] = palette[n + 2];
    +
    5306  p += 3;
    +
    5307  }
    +
    5308  } else {
    +
    5309  for (i = 0; i < pixel_count; ++i) {
    +
    5310  int n = orig[i] * 4;
    +
    5311  p[0] = palette[n];
    +
    5312  p[1] = palette[n + 1];
    +
    5313  p[2] = palette[n + 2];
    +
    5314  p[3] = palette[n + 3];
    +
    5315  p += 4;
    +
    5316  }
    +
    5317  }
    +
    5318  STBI_FREE(a->out);
    +
    5319  a->out = temp_out;
    +
    5320 
    +
    5321  STBI_NOTUSED(len);
    +
    5322 
    +
    5323  return 1;
    +
    5324 }
    +
    5325 
    +
    5326 static int stbi__unpremultiply_on_load = 0;
    +
    5327 static int stbi__de_iphone_flag = 0;
    +
    5328 
    +
    5329 STBIDEF void
    +
    5330 stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
    +
    5331 {
    +
    5332  stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;
    +
    5333 }
    +
    5334 
    +
    5335 STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
    +
    5336 {
    +
    5337  stbi__de_iphone_flag = flag_true_if_should_convert;
    +
    5338 }
    +
    5339 
    +
    5340 static void stbi__de_iphone(stbi__png *z)
    +
    5341 {
    +
    5342  stbi__context *s = z->s;
    +
    5343  stbi__uint32 i, pixel_count = s->img_x * s->img_y;
    +
    5344  stbi_uc *p = z->out;
    +
    5345 
    +
    5346  if (s->img_out_n == 3) { // convert bgr to rgb
    +
    5347  for (i = 0; i < pixel_count; ++i) {
    +
    5348  stbi_uc t = p[0];
    +
    5349  p[0] = p[2];
    +
    5350  p[2] = t;
    +
    5351  p += 3;
    +
    5352  }
    +
    5353  } else {
    +
    5354  STBI_ASSERT(s->img_out_n == 4);
    +
    5355  if (stbi__unpremultiply_on_load) {
    +
    5356  // convert bgr to rgb and unpremultiply
    +
    5357  for (i = 0; i < pixel_count; ++i) {
    +
    5358  stbi_uc a = p[3];
    +
    5359  stbi_uc t = p[0];
    +
    5360  if (a) {
    +
    5361  stbi_uc half = a / 2;
    +
    5362  p[0] = (p[2] * 255 + half) / a;
    +
    5363  p[1] = (p[1] * 255 + half) / a;
    +
    5364  p[2] = (t * 255 + half) / a;
    +
    5365  } else {
    +
    5366  p[0] = p[2];
    +
    5367  p[2] = t;
    +
    5368  }
    +
    5369  p += 4;
    +
    5370  }
    +
    5371  } else {
    +
    5372  // convert bgr to rgb
    +
    5373  for (i = 0; i < pixel_count; ++i) {
    +
    5374  stbi_uc t = p[0];
    +
    5375  p[0] = p[2];
    +
    5376  p[2] = t;
    +
    5377  p += 4;
    +
    5378  }
    +
    5379  }
    +
    5380  }
    +
    5381 }
    +
    5382 
    +
    5383 #define STBI__PNG_TYPE(a, b, c, d) \
    +
    5384  (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
    +
    5385 
    +
    5386 static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
    +
    5387 {
    +
    5388  stbi_uc palette[1024], pal_img_n = 0;
    +
    5389  stbi_uc has_trans = 0, tc[3];
    +
    5390  stbi__uint16 tc16[3];
    +
    5391  stbi__uint32 ioff = 0, idata_limit = 0, i, pal_len = 0;
    +
    5392  int first = 1, k, interlace = 0, color = 0, is_iphone = 0;
    +
    5393  stbi__context *s = z->s;
    +
    5394 
    +
    5395  z->expanded = NULL;
    +
    5396  z->idata = NULL;
    +
    5397  z->out = NULL;
    +
    5398 
    +
    5399  if (!stbi__check_png_header(s))
    +
    5400  return 0;
    +
    5401 
    +
    5402  if (scan == STBI__SCAN_type)
    +
    5403  return 1;
    +
    5404 
    +
    5405  for (;;) {
    +
    5406  stbi__pngchunk c = stbi__get_chunk_header(s);
    +
    5407  switch (c.type) {
    +
    5408  case STBI__PNG_TYPE('C', 'g', 'B', 'I'):
    +
    5409  is_iphone = 1;
    +
    5410  stbi__skip(s, c.length);
    +
    5411  break;
    +
    5412  case STBI__PNG_TYPE('I', 'H', 'D', 'R'): {
    +
    5413  int comp, filter;
    +
    5414  if (!first)
    +
    5415  return stbi__err("multiple IHDR", "Corrupt PNG");
    +
    5416  first = 0;
    +
    5417  if (c.length != 13)
    +
    5418  return stbi__err("bad IHDR len", "Corrupt PNG");
    +
    5419  s->img_x = stbi__get32be(s);
    +
    5420  if (s->img_x > (1 << 24))
    +
    5421  return stbi__err("too large", "Very large image (corrupt?)");
    +
    5422  s->img_y = stbi__get32be(s);
    +
    5423  if (s->img_y > (1 << 24))
    +
    5424  return stbi__err("too large", "Very large image (corrupt?)");
    +
    5425  z->depth = stbi__get8(s);
    +
    5426  if (z->depth != 1 && z->depth != 2 && z->depth != 4 &&
    +
    5427  z->depth != 8 && z->depth != 16)
    +
    5428  return stbi__err("1/2/4/8/16-bit only",
    +
    5429  "PNG not supported: 1/2/4/8/16-bit only");
    +
    5430  color = stbi__get8(s);
    +
    5431  if (color > 6)
    +
    5432  return stbi__err("bad ctype", "Corrupt PNG");
    +
    5433  if (color == 3 && z->depth == 16)
    +
    5434  return stbi__err("bad ctype", "Corrupt PNG");
    +
    5435  if (color == 3)
    +
    5436  pal_img_n = 3;
    +
    5437  else if (color & 1)
    +
    5438  return stbi__err("bad ctype", "Corrupt PNG");
    +
    5439  comp = stbi__get8(s);
    +
    5440  if (comp)
    +
    5441  return stbi__err("bad comp method", "Corrupt PNG");
    +
    5442  filter = stbi__get8(s);
    +
    5443  if (filter)
    +
    5444  return stbi__err("bad filter method", "Corrupt PNG");
    +
    5445  interlace = stbi__get8(s);
    +
    5446  if (interlace > 1)
    +
    5447  return stbi__err("bad interlace method", "Corrupt PNG");
    +
    5448  if (!s->img_x || !s->img_y)
    +
    5449  return stbi__err("0-pixel image", "Corrupt PNG");
    +
    5450  if (!pal_img_n) {
    +
    5451  s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
    +
    5452  if ((1 << 30) / s->img_x / s->img_n < s->img_y)
    +
    5453  return stbi__err("too large", "Image too large to decode");
    +
    5454  if (scan == STBI__SCAN_header)
    +
    5455  return 1;
    +
    5456  } else {
    +
    5457  // if paletted, then pal_n is our final components, and
    +
    5458  // img_n is # components to decompress/filter.
    +
    5459  s->img_n = 1;
    +
    5460  if ((1 << 30) / s->img_x / 4 < s->img_y)
    +
    5461  return stbi__err("too large", "Corrupt PNG");
    +
    5462  // if SCAN_header, have to scan to see if we have a tRNS
    +
    5463  }
    +
    5464  break;
    +
    5465  }
    +
    5466 
    +
    5467  case STBI__PNG_TYPE('P', 'L', 'T', 'E'): {
    +
    5468  if (first)
    +
    5469  return stbi__err("first not IHDR", "Corrupt PNG");
    +
    5470  if (c.length > 256 * 3)
    +
    5471  return stbi__err("invalid PLTE", "Corrupt PNG");
    +
    5472  pal_len = c.length / 3;
    +
    5473  if (pal_len * 3 != c.length)
    +
    5474  return stbi__err("invalid PLTE", "Corrupt PNG");
    +
    5475  for (i = 0; i < pal_len; ++i) {
    +
    5476  palette[i * 4 + 0] = stbi__get8(s);
    +
    5477  palette[i * 4 + 1] = stbi__get8(s);
    +
    5478  palette[i * 4 + 2] = stbi__get8(s);
    +
    5479  palette[i * 4 + 3] = 255;
    +
    5480  }
    +
    5481  break;
    +
    5482  }
    +
    5483 
    +
    5484  case STBI__PNG_TYPE('t', 'R', 'N', 'S'): {
    +
    5485  if (first)
    +
    5486  return stbi__err("first not IHDR", "Corrupt PNG");
    +
    5487  if (z->idata)
    +
    5488  return stbi__err("tRNS after IDAT", "Corrupt PNG");
    +
    5489  if (pal_img_n) {
    +
    5490  if (scan == STBI__SCAN_header) {
    +
    5491  s->img_n = 4;
    +
    5492  return 1;
    +
    5493  }
    +
    5494  if (pal_len == 0)
    +
    5495  return stbi__err("tRNS before PLTE", "Corrupt PNG");
    +
    5496  if (c.length > pal_len)
    +
    5497  return stbi__err("bad tRNS len", "Corrupt PNG");
    +
    5498  pal_img_n = 4;
    +
    5499  for (i = 0; i < c.length; ++i)
    +
    5500  palette[i * 4 + 3] = stbi__get8(s);
    +
    5501  } else {
    +
    5502  if (!(s->img_n & 1))
    +
    5503  return stbi__err("tRNS with alpha", "Corrupt PNG");
    +
    5504  if (c.length != (stbi__uint32)s->img_n * 2)
    +
    5505  return stbi__err("bad tRNS len", "Corrupt PNG");
    +
    5506  has_trans = 1;
    +
    5507  if (z->depth == 16) {
    +
    5508  for (k = 0; k < s->img_n; ++k)
    +
    5509  tc16[k] = (stbi__uint16)stbi__get16be(
    +
    5510  s); // copy the values as-is
    +
    5511  } else {
    +
    5512  for (k = 0; k < s->img_n; ++k)
    +
    5513  tc[k] = (stbi_uc)(stbi__get16be(s) & 255) *
    +
    5514  stbi__depth_scale_table[z->depth]; // non 8-bit
    +
    5515  // images
    +
    5516  // will be
    +
    5517  // larger
    +
    5518  }
    +
    5519  }
    +
    5520  break;
    +
    5521  }
    +
    5522 
    +
    5523  case STBI__PNG_TYPE('I', 'D', 'A', 'T'): {
    +
    5524  if (first)
    +
    5525  return stbi__err("first not IHDR", "Corrupt PNG");
    +
    5526  if (pal_img_n && !pal_len)
    +
    5527  return stbi__err("no PLTE", "Corrupt PNG");
    +
    5528  if (scan == STBI__SCAN_header) {
    +
    5529  s->img_n = pal_img_n;
    +
    5530  return 1;
    +
    5531  }
    +
    5532  if ((int)(ioff + c.length) < (int)ioff)
    +
    5533  return 0;
    +
    5534  if (ioff + c.length > idata_limit) {
    +
    5535  stbi__uint32 idata_limit_old = idata_limit;
    +
    5536  stbi_uc *p;
    +
    5537  if (idata_limit == 0)
    +
    5538  idata_limit = c.length > 4096 ? c.length : 4096;
    +
    5539  while (ioff + c.length > idata_limit)
    +
    5540  idata_limit *= 2;
    +
    5541  STBI_NOTUSED(idata_limit_old);
    +
    5542  p = (stbi_uc *)STBI_REALLOC_SIZED(z->idata, idata_limit_old,
    +
    5543  idata_limit);
    +
    5544  if (p == NULL)
    +
    5545  return stbi__err("outofmem", "Out of memory");
    +
    5546  z->idata = p;
    +
    5547  }
    +
    5548  if (!stbi__getn(s, z->idata + ioff, c.length))
    +
    5549  return stbi__err("outofdata", "Corrupt PNG");
    +
    5550  ioff += c.length;
    +
    5551  break;
    +
    5552  }
    5553 
    -
    5554  // the things I do to get rid of an error message, and yet keep
    -
    5555  // Microsoft's C compilers happy... [8^(
    -
    5556  tga_palette_start = tga_palette_len = tga_palette_bits =
    -
    5557  tga_x_origin = tga_y_origin = 0;
    -
    5558  // OK, done
    -
    5559  return tga_data;
    -
    5560 }
    -
    5561 #endif
    -
    5562 
    -
    5563 // *************************************************************************************************
    -
    5564 // Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
    -
    5565 
    -
    5566 #ifndef STBI_NO_PSD
    -
    5567 static int stbi__psd_test(stbi__context *s)
    -
    5568 {
    -
    5569  int r = (stbi__get32be(s) == 0x38425053);
    -
    5570  stbi__rewind(s);
    -
    5571  return r;
    -
    5572 }
    -
    5573 
    -
    5574 static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount)
    -
    5575 {
    -
    5576  int count, nleft, len;
    -
    5577 
    -
    5578  count = 0;
    -
    5579  while ((nleft = pixelCount - count) > 0) {
    -
    5580  len = stbi__get8(s);
    -
    5581  if (len == 128) {
    -
    5582  // No-op.
    -
    5583  } else if (len < 128) {
    -
    5584  // Copy next len+1 bytes literally.
    -
    5585  len++;
    -
    5586  if (len > nleft) return 0; // corrupt data
    -
    5587  count += len;
    -
    5588  while (len) {
    -
    5589  *p = stbi__get8(s);
    -
    5590  p += 4;
    -
    5591  len--;
    -
    5592  }
    -
    5593  } else if (len > 128) {
    -
    5594  stbi_uc val;
    -
    5595  // Next -len+1 bytes in the dest are replicated from next source byte.
    -
    5596  // (Interpret len as a negative 8-bit int.)
    -
    5597  len = 257 - len;
    -
    5598  if (len > nleft) return 0; // corrupt data
    -
    5599  val = stbi__get8(s);
    -
    5600  count += len;
    -
    5601  while (len) {
    -
    5602  *p = val;
    -
    5603  p += 4;
    -
    5604  len--;
    -
    5605  }
    -
    5606  }
    -
    5607  }
    -
    5608 
    -
    5609  return 1;
    -
    5610 }
    -
    5611 
    -
    5612 static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
    -
    5613 {
    -
    5614  int pixelCount;
    -
    5615  int channelCount, compression;
    -
    5616  int channel, i;
    -
    5617  int bitdepth;
    -
    5618  int w,h;
    -
    5619  stbi_uc *out;
    -
    5620  STBI_NOTUSED(ri);
    -
    5621 
    -
    5622  // Check identifier
    -
    5623  if (stbi__get32be(s) != 0x38425053) // "8BPS"
    -
    5624  return stbi__errpuc("not PSD", "Corrupt PSD image");
    -
    5625 
    -
    5626  // Check file type version.
    -
    5627  if (stbi__get16be(s) != 1)
    -
    5628  return stbi__errpuc("wrong version", "Unsupported version of PSD image");
    -
    5629 
    -
    5630  // Skip 6 reserved bytes.
    -
    5631  stbi__skip(s, 6 );
    -
    5632 
    -
    5633  // Read the number of channels (R, G, B, A, etc).
    -
    5634  channelCount = stbi__get16be(s);
    -
    5635  if (channelCount < 0 || channelCount > 16)
    -
    5636  return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");
    -
    5637 
    -
    5638  // Read the rows and columns of the image.
    -
    5639  h = stbi__get32be(s);
    -
    5640  w = stbi__get32be(s);
    -
    5641 
    -
    5642  // Make sure the depth is 8 bits.
    -
    5643  bitdepth = stbi__get16be(s);
    -
    5644  if (bitdepth != 8 && bitdepth != 16)
    -
    5645  return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit");
    -
    5646 
    -
    5647  // Make sure the color mode is RGB.
    -
    5648  // Valid options are:
    -
    5649  // 0: Bitmap
    -
    5650  // 1: Grayscale
    -
    5651  // 2: Indexed color
    -
    5652  // 3: RGB color
    -
    5653  // 4: CMYK color
    -
    5654  // 7: Multichannel
    -
    5655  // 8: Duotone
    -
    5656  // 9: Lab color
    -
    5657  if (stbi__get16be(s) != 3)
    -
    5658  return stbi__errpuc("wrong color format", "PSD is not in RGB color format");
    -
    5659 
    -
    5660  // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)
    -
    5661  stbi__skip(s,stbi__get32be(s) );
    -
    5662 
    -
    5663  // Skip the image resources. (resolution, pen tool paths, etc)
    -
    5664  stbi__skip(s, stbi__get32be(s) );
    -
    5665 
    -
    5666  // Skip the reserved data.
    -
    5667  stbi__skip(s, stbi__get32be(s) );
    -
    5668 
    -
    5669  // Find out if the data is compressed.
    -
    5670  // Known values:
    -
    5671  // 0: no compression
    -
    5672  // 1: RLE compressed
    -
    5673  compression = stbi__get16be(s);
    -
    5674  if (compression > 1)
    -
    5675  return stbi__errpuc("bad compression", "PSD has an unknown compression format");
    -
    5676 
    -
    5677  // Check size
    -
    5678  if (!stbi__mad3sizes_valid(4, w, h, 0))
    -
    5679  return stbi__errpuc("too large", "Corrupt PSD");
    -
    5680 
    -
    5681  // Create the destination image.
    -
    5682 
    -
    5683  if (!compression && bitdepth == 16 && bpc == 16) {
    -
    5684  out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
    -
    5685  ri->bits_per_channel = 16;
    -
    5686  } else
    -
    5687  out = (stbi_uc *) stbi__malloc(4 * w*h);
    -
    5688 
    -
    5689  if (!out) return stbi__errpuc("outofmem", "Out of memory");
    -
    5690  pixelCount = w*h;
    -
    5691 
    -
    5692  // Initialize the data to zero.
    -
    5693  //memset( out, 0, pixelCount * 4 );
    -
    5694 
    -
    5695  // Finally, the image data.
    -
    5696  if (compression) {
    -
    5697  // RLE as used by .PSD and .TIFF
    -
    5698  // Loop until you get the number of unpacked bytes you are expecting:
    -
    5699  // Read the next source byte into n.
    -
    5700  // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
    -
    5701  // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
    -
    5702  // Else if n is 128, noop.
    -
    5703  // Endloop
    -
    5704 
    -
    5705  // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
    -
    5706  // which we're going to just skip.
    -
    5707  stbi__skip(s, h * channelCount * 2 );
    +
    5554  case STBI__PNG_TYPE('I', 'E', 'N', 'D'): {
    +
    5555  stbi__uint32 raw_len, bpl;
    +
    5556  if (first)
    +
    5557  return stbi__err("first not IHDR", "Corrupt PNG");
    +
    5558  if (scan != STBI__SCAN_load)
    +
    5559  return 1;
    +
    5560  if (z->idata == NULL)
    +
    5561  return stbi__err("no IDAT", "Corrupt PNG");
    +
    5562  // initial guess for decoded data size to avoid unnecessary reallocs
    +
    5563  bpl =
    +
    5564  (s->img_x * z->depth + 7) / 8; // bytes per line, per component
    +
    5565  raw_len = bpl * s->img_y * s->img_n /* pixels */ +
    +
    5566  s->img_y /* filter mode per row */;
    +
    5567  z->expanded =
    + +
    5569  (char *)z->idata, ioff, raw_len, (int *)&raw_len,
    +
    5570  !is_iphone);
    +
    5571  if (z->expanded == NULL)
    +
    5572  return 0; // zlib should set error
    +
    5573  STBI_FREE(z->idata);
    +
    5574  z->idata = NULL;
    +
    5575  if ((req_comp == s->img_n + 1 && req_comp != 3 && !pal_img_n) ||
    +
    5576  has_trans)
    +
    5577  s->img_out_n = s->img_n + 1;
    +
    5578  else
    +
    5579  s->img_out_n = s->img_n;
    +
    5580  if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n,
    +
    5581  z->depth, color, interlace))
    +
    5582  return 0;
    +
    5583  if (has_trans) {
    +
    5584  if (z->depth == 16) {
    +
    5585  if (!stbi__compute_transparency16(z, tc16, s->img_out_n))
    +
    5586  return 0;
    +
    5587  } else {
    +
    5588  if (!stbi__compute_transparency(z, tc, s->img_out_n))
    +
    5589  return 0;
    +
    5590  }
    +
    5591  }
    +
    5592  if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
    +
    5593  stbi__de_iphone(z);
    +
    5594  if (pal_img_n) {
    +
    5595  // pal_img_n == 3 or 4
    +
    5596  s->img_n = pal_img_n; // record the actual colors we had
    +
    5597  s->img_out_n = pal_img_n;
    +
    5598  if (req_comp >= 3)
    +
    5599  s->img_out_n = req_comp;
    +
    5600  if (!stbi__expand_png_palette(z, palette, pal_len,
    +
    5601  s->img_out_n))
    +
    5602  return 0;
    +
    5603  } else if (has_trans) {
    +
    5604  // non-paletted image with tRNS -> source image has (constant)
    +
    5605  // alpha
    +
    5606  ++s->img_n;
    +
    5607  }
    +
    5608  STBI_FREE(z->expanded);
    +
    5609  z->expanded = NULL;
    +
    5610  return 1;
    +
    5611  }
    +
    5612 
    +
    5613  default:
    +
    5614  // if critical, fail
    +
    5615  if (first)
    +
    5616  return stbi__err("first not IHDR", "Corrupt PNG");
    +
    5617  if ((c.type & (1 << 29)) == 0) {
    +
    5618 #ifndef STBI_NO_FAILURE_STRINGS
    +
    5619  // not threadsafe
    +
    5620  static char invalid_chunk[] = "XXXX PNG chunk not known";
    +
    5621  invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
    +
    5622  invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
    +
    5623  invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);
    +
    5624  invalid_chunk[3] = STBI__BYTECAST(c.type >> 0);
    +
    5625 #endif
    +
    5626  return stbi__err(invalid_chunk,
    +
    5627  "PNG not supported: unknown PNG chunk type");
    +
    5628  }
    +
    5629  stbi__skip(s, c.length);
    +
    5630  break;
    +
    5631  }
    +
    5632  // end of PNG chunk, read and skip CRC
    +
    5633  stbi__get32be(s);
    +
    5634  }
    +
    5635 }
    +
    5636 
    +
    5637 static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp,
    +
    5638  stbi__result_info *ri)
    +
    5639 {
    +
    5640  void *result = NULL;
    +
    5641  if (req_comp < 0 || req_comp > 4)
    +
    5642  return stbi__errpuc("bad req_comp", "Internal error");
    +
    5643  if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
    +
    5644  if (p->depth < 8)
    +
    5645  ri->bits_per_channel = 8;
    +
    5646  else
    +
    5647  ri->bits_per_channel = p->depth;
    +
    5648  result = p->out;
    +
    5649  p->out = NULL;
    +
    5650  if (req_comp && req_comp != p->s->img_out_n) {
    +
    5651  if (ri->bits_per_channel == 8)
    +
    5652  result = stbi__convert_format((unsigned char *)result,
    +
    5653  p->s->img_out_n, req_comp,
    +
    5654  p->s->img_x, p->s->img_y);
    +
    5655  else
    +
    5656  result = stbi__convert_format16((stbi__uint16 *)result,
    +
    5657  p->s->img_out_n, req_comp,
    +
    5658  p->s->img_x, p->s->img_y);
    +
    5659  p->s->img_out_n = req_comp;
    +
    5660  if (result == NULL)
    +
    5661  return result;
    +
    5662  }
    +
    5663  *x = p->s->img_x;
    +
    5664  *y = p->s->img_y;
    +
    5665  if (n)
    +
    5666  *n = p->s->img_n;
    +
    5667  }
    +
    5668  STBI_FREE(p->out);
    +
    5669  p->out = NULL;
    +
    5670  STBI_FREE(p->expanded);
    +
    5671  p->expanded = NULL;
    +
    5672  STBI_FREE(p->idata);
    +
    5673  p->idata = NULL;
    +
    5674 
    +
    5675  return result;
    +
    5676 }
    +
    5677 
    +
    5678 static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp,
    +
    5679  int req_comp, stbi__result_info *ri)
    +
    5680 {
    +
    5681  stbi__png p;
    +
    5682  p.s = s;
    +
    5683  return stbi__do_png(&p, x, y, comp, req_comp, ri);
    +
    5684 }
    +
    5685 
    +
    5686 static int stbi__png_test(stbi__context *s)
    +
    5687 {
    +
    5688  int r;
    +
    5689  r = stbi__check_png_header(s);
    +
    5690  stbi__rewind(s);
    +
    5691  return r;
    +
    5692 }
    +
    5693 
    +
    5694 static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
    +
    5695 {
    +
    5696  if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {
    +
    5697  stbi__rewind(p->s);
    +
    5698  return 0;
    +
    5699  }
    +
    5700  if (x)
    +
    5701  *x = p->s->img_x;
    +
    5702  if (y)
    +
    5703  *y = p->s->img_y;
    +
    5704  if (comp)
    +
    5705  *comp = p->s->img_n;
    +
    5706  return 1;
    +
    5707 }
    5708 
    -
    5709  // Read the RLE data by channel.
    -
    5710  for (channel = 0; channel < 4; channel++) {
    -
    5711  stbi_uc *p;
    -
    5712 
    -
    5713  p = out+channel;
    -
    5714  if (channel >= channelCount) {
    -
    5715  // Fill this channel with default data.
    -
    5716  for (i = 0; i < pixelCount; i++, p += 4)
    -
    5717  *p = (channel == 3 ? 255 : 0);
    -
    5718  } else {
    -
    5719  // Read the RLE data.
    -
    5720  if (!stbi__psd_decode_rle(s, p, pixelCount)) {
    -
    5721  STBI_FREE(out);
    -
    5722  return stbi__errpuc("corrupt", "bad RLE data");
    -
    5723  }
    -
    5724  }
    -
    5725  }
    -
    5726 
    -
    5727  } else {
    -
    5728  // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
    -
    5729  // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image.
    -
    5730 
    -
    5731  // Read the data by channel.
    -
    5732  for (channel = 0; channel < 4; channel++) {
    -
    5733  if (channel >= channelCount) {
    -
    5734  // Fill this channel with default data.
    -
    5735  if (bitdepth == 16 && bpc == 16) {
    -
    5736  stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
    -
    5737  stbi__uint16 val = channel == 3 ? 65535 : 0;
    -
    5738  for (i = 0; i < pixelCount; i++, q += 4)
    -
    5739  *q = val;
    -
    5740  } else {
    -
    5741  stbi_uc *p = out+channel;
    -
    5742  stbi_uc val = channel == 3 ? 255 : 0;
    -
    5743  for (i = 0; i < pixelCount; i++, p += 4)
    -
    5744  *p = val;
    -
    5745  }
    -
    5746  } else {
    -
    5747  if (ri->bits_per_channel == 16) { // output bpc
    -
    5748  stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
    -
    5749  for (i = 0; i < pixelCount; i++, q += 4)
    -
    5750  *q = (stbi__uint16) stbi__get16be(s);
    -
    5751  } else {
    -
    5752  stbi_uc *p = out+channel;
    -
    5753  if (bitdepth == 16) { // input bpc
    -
    5754  for (i = 0; i < pixelCount; i++, p += 4)
    -
    5755  *p = (stbi_uc) (stbi__get16be(s) >> 8);
    -
    5756  } else {
    -
    5757  for (i = 0; i < pixelCount; i++, p += 4)
    -
    5758  *p = stbi__get8(s);
    -
    5759  }
    -
    5760  }
    -
    5761  }
    -
    5762  }
    -
    5763  }
    -
    5764 
    -
    5765  // remove weird white matte from PSD
    -
    5766  if (channelCount >= 4) {
    -
    5767  if (ri->bits_per_channel == 16) {
    -
    5768  for (i=0; i < w*h; ++i) {
    -
    5769  stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;
    -
    5770  if (pixel[3] != 0 && pixel[3] != 65535) {
    -
    5771  float a = pixel[3] / 65535.0f;
    -
    5772  float ra = 1.0f / a;
    -
    5773  float inv_a = 65535.0f * (1 - ra);
    -
    5774  pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a);
    -
    5775  pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a);
    -
    5776  pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a);
    -
    5777  }
    -
    5778  }
    -
    5779  } else {
    -
    5780  for (i=0; i < w*h; ++i) {
    -
    5781  unsigned char *pixel = out + 4*i;
    -
    5782  if (pixel[3] != 0 && pixel[3] != 255) {
    -
    5783  float a = pixel[3] / 255.0f;
    -
    5784  float ra = 1.0f / a;
    -
    5785  float inv_a = 255.0f * (1 - ra);
    -
    5786  pixel[0] = (unsigned char) (pixel[0]*ra + inv_a);
    -
    5787  pixel[1] = (unsigned char) (pixel[1]*ra + inv_a);
    -
    5788  pixel[2] = (unsigned char) (pixel[2]*ra + inv_a);
    -
    5789  }
    -
    5790  }
    -
    5791  }
    -
    5792  }
    -
    5793 
    -
    5794  // convert to desired output format
    -
    5795  if (req_comp && req_comp != 4) {
    -
    5796  if (ri->bits_per_channel == 16)
    -
    5797  out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);
    -
    5798  else
    -
    5799  out = stbi__convert_format(out, 4, req_comp, w, h);
    -
    5800  if (out == NULL) return out; // stbi__convert_format frees input on failure
    -
    5801  }
    -
    5802 
    -
    5803  if (comp) *comp = 4;
    -
    5804  *y = h;
    -
    5805  *x = w;
    -
    5806 
    -
    5807  return out;
    -
    5808 }
    -
    5809 #endif
    -
    5810 
    -
    5811 // *************************************************************************************************
    -
    5812 // Softimage PIC loader
    -
    5813 // by Tom Seddon
    -
    5814 //
    -
    5815 // See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
    -
    5816 // See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
    -
    5817 
    -
    5818 #ifndef STBI_NO_PIC
    -
    5819 static int stbi__pic_is4(stbi__context *s,const char *str)
    -
    5820 {
    -
    5821  int i;
    -
    5822  for (i=0; i<4; ++i)
    -
    5823  if (stbi__get8(s) != (stbi_uc)str[i])
    -
    5824  return 0;
    -
    5825 
    -
    5826  return 1;
    -
    5827 }
    -
    5828 
    -
    5829 static int stbi__pic_test_core(stbi__context *s)
    -
    5830 {
    -
    5831  int i;
    -
    5832 
    -
    5833  if (!stbi__pic_is4(s,"\x53\x80\xF6\x34"))
    -
    5834  return 0;
    -
    5835 
    -
    5836  for(i=0;i<84;++i)
    -
    5837  stbi__get8(s);
    -
    5838 
    -
    5839  if (!stbi__pic_is4(s,"PICT"))
    -
    5840  return 0;
    -
    5841 
    -
    5842  return 1;
    -
    5843 }
    -
    5844 
    -
    5845 typedef struct
    -
    5846 {
    -
    5847  stbi_uc size,type,channel;
    -
    5848 } stbi__pic_packet;
    -
    5849 
    -
    5850 static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
    -
    5851 {
    -
    5852  int mask=0x80, i;
    -
    5853 
    -
    5854  for (i=0; i<4; ++i, mask>>=1) {
    -
    5855  if (channel & mask) {
    -
    5856  if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short");
    -
    5857  dest[i]=stbi__get8(s);
    -
    5858  }
    -
    5859  }
    -
    5860 
    -
    5861  return dest;
    -
    5862 }
    -
    5863 
    -
    5864 static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)
    -
    5865 {
    -
    5866  int mask=0x80,i;
    -
    5867 
    -
    5868  for (i=0;i<4; ++i, mask>>=1)
    -
    5869  if (channel&mask)
    -
    5870  dest[i]=src[i];
    -
    5871 }
    -
    5872 
    -
    5873 static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result)
    -
    5874 {
    -
    5875  int act_comp=0,num_packets=0,y,chained;
    -
    5876  stbi__pic_packet packets[10];
    -
    5877 
    -
    5878  // this will (should...) cater for even some bizarre stuff like having data
    -
    5879  // for the same channel in multiple packets.
    -
    5880  do {
    -
    5881  stbi__pic_packet *packet;
    -
    5882 
    -
    5883  if (num_packets==sizeof(packets)/sizeof(packets[0]))
    -
    5884  return stbi__errpuc("bad format","too many packets");
    -
    5885 
    -
    5886  packet = &packets[num_packets++];
    +
    5709 static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
    +
    5710 {
    +
    5711  stbi__png p;
    +
    5712  p.s = s;
    +
    5713  return stbi__png_info_raw(&p, x, y, comp);
    +
    5714 }
    +
    5715 #endif
    +
    5716 
    +
    5717  // Microsoft/Windows BMP image
    +
    5718 
    +
    5719 #ifndef STBI_NO_BMP
    +
    5720 static int stbi__bmp_test_raw(stbi__context *s)
    +
    5721 {
    +
    5722  int r;
    +
    5723  int sz;
    +
    5724  if (stbi__get8(s) != 'B')
    +
    5725  return 0;
    +
    5726  if (stbi__get8(s) != 'M')
    +
    5727  return 0;
    +
    5728  stbi__get32le(s); // discard filesize
    +
    5729  stbi__get16le(s); // discard reserved
    +
    5730  stbi__get16le(s); // discard reserved
    +
    5731  stbi__get32le(s); // discard data offset
    +
    5732  sz = stbi__get32le(s);
    +
    5733  r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
    +
    5734  return r;
    +
    5735 }
    +
    5736 
    +
    5737 static int stbi__bmp_test(stbi__context *s)
    +
    5738 {
    +
    5739  int r = stbi__bmp_test_raw(s);
    +
    5740  stbi__rewind(s);
    +
    5741  return r;
    +
    5742 }
    +
    5743 
    +
    5744 // returns 0..31 for the highest set bit
    +
    5745 static int stbi__high_bit(unsigned int z)
    +
    5746 {
    +
    5747  int n = 0;
    +
    5748  if (z == 0)
    +
    5749  return -1;
    +
    5750  if (z >= 0x10000)
    +
    5751  n += 16, z >>= 16;
    +
    5752  if (z >= 0x00100)
    +
    5753  n += 8, z >>= 8;
    +
    5754  if (z >= 0x00010)
    +
    5755  n += 4, z >>= 4;
    +
    5756  if (z >= 0x00004)
    +
    5757  n += 2, z >>= 2;
    +
    5758  if (z >= 0x00002)
    +
    5759  n += 1, z >>= 1;
    +
    5760  return n;
    +
    5761 }
    +
    5762 
    +
    5763 static int stbi__bitcount(unsigned int a)
    +
    5764 {
    +
    5765  a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
    +
    5766  a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
    +
    5767  a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
    +
    5768  a = (a + (a >> 8)); // max 16 per 8 bits
    +
    5769  a = (a + (a >> 16)); // max 32 per 8 bits
    +
    5770  return a & 0xff;
    +
    5771 }
    +
    5772 
    +
    5773 static int stbi__shiftsigned(int v, int shift, int bits)
    +
    5774 {
    +
    5775  int result;
    +
    5776  int z = 0;
    +
    5777 
    +
    5778  if (shift < 0)
    +
    5779  v <<= -shift;
    +
    5780  else
    +
    5781  v >>= shift;
    +
    5782  result = v;
    +
    5783 
    +
    5784  z = bits;
    +
    5785  while (z < 8) {
    +
    5786  result += v >> z;
    +
    5787  z += bits;
    +
    5788  }
    +
    5789  return result;
    +
    5790 }
    +
    5791 
    +
    5792 typedef struct {
    +
    5793  int bpp, offset, hsz;
    +
    5794  unsigned int mr, mg, mb, ma, all_a;
    +
    5795 } stbi__bmp_data;
    +
    5796 
    +
    5797 static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
    +
    5798 {
    +
    5799  int hsz;
    +
    5800  if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M')
    +
    5801  return stbi__errpuc("not BMP", "Corrupt BMP");
    +
    5802  stbi__get32le(s); // discard filesize
    +
    5803  stbi__get16le(s); // discard reserved
    +
    5804  stbi__get16le(s); // discard reserved
    +
    5805  info->offset = stbi__get32le(s);
    +
    5806  info->hsz = hsz = stbi__get32le(s);
    +
    5807  info->mr = info->mg = info->mb = info->ma = 0;
    +
    5808 
    +
    5809  if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124)
    +
    5810  return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
    +
    5811  if (hsz == 12) {
    +
    5812  s->img_x = stbi__get16le(s);
    +
    5813  s->img_y = stbi__get16le(s);
    +
    5814  } else {
    +
    5815  s->img_x = stbi__get32le(s);
    +
    5816  s->img_y = stbi__get32le(s);
    +
    5817  }
    +
    5818  if (stbi__get16le(s) != 1)
    +
    5819  return stbi__errpuc("bad BMP", "bad BMP");
    +
    5820  info->bpp = stbi__get16le(s);
    +
    5821  if (info->bpp == 1)
    +
    5822  return stbi__errpuc("monochrome", "BMP type not supported: 1-bit");
    +
    5823  if (hsz != 12) {
    +
    5824  int compress = stbi__get32le(s);
    +
    5825  if (compress == 1 || compress == 2)
    +
    5826  return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
    +
    5827  stbi__get32le(s); // discard sizeof
    +
    5828  stbi__get32le(s); // discard hres
    +
    5829  stbi__get32le(s); // discard vres
    +
    5830  stbi__get32le(s); // discard colorsused
    +
    5831  stbi__get32le(s); // discard max important
    +
    5832  if (hsz == 40 || hsz == 56) {
    +
    5833  if (hsz == 56) {
    +
    5834  stbi__get32le(s);
    +
    5835  stbi__get32le(s);
    +
    5836  stbi__get32le(s);
    +
    5837  stbi__get32le(s);
    +
    5838  }
    +
    5839  if (info->bpp == 16 || info->bpp == 32) {
    +
    5840  if (compress == 0) {
    +
    5841  if (info->bpp == 32) {
    +
    5842  info->mr = 0xffu << 16;
    +
    5843  info->mg = 0xffu << 8;
    +
    5844  info->mb = 0xffu << 0;
    +
    5845  info->ma = 0xffu << 24;
    +
    5846  info->all_a = 0; // if all_a is 0 at end, then we loaded
    +
    5847  // alpha channel but it was all 0
    +
    5848  } else {
    +
    5849  info->mr = 31u << 10;
    +
    5850  info->mg = 31u << 5;
    +
    5851  info->mb = 31u << 0;
    +
    5852  }
    +
    5853  } else if (compress == 3) {
    +
    5854  info->mr = stbi__get32le(s);
    +
    5855  info->mg = stbi__get32le(s);
    +
    5856  info->mb = stbi__get32le(s);
    +
    5857  // not documented, but generated by photoshop and handled by
    +
    5858  // mspaint
    +
    5859  if (info->mr == info->mg && info->mg == info->mb) {
    +
    5860  // ?!?!?
    +
    5861  return stbi__errpuc("bad BMP", "bad BMP");
    +
    5862  }
    +
    5863  } else
    +
    5864  return stbi__errpuc("bad BMP", "bad BMP");
    +
    5865  }
    +
    5866  } else {
    +
    5867  int i;
    +
    5868  if (hsz != 108 && hsz != 124)
    +
    5869  return stbi__errpuc("bad BMP", "bad BMP");
    +
    5870  info->mr = stbi__get32le(s);
    +
    5871  info->mg = stbi__get32le(s);
    +
    5872  info->mb = stbi__get32le(s);
    +
    5873  info->ma = stbi__get32le(s);
    +
    5874  stbi__get32le(s); // discard color space
    +
    5875  for (i = 0; i < 12; ++i)
    +
    5876  stbi__get32le(s); // discard color space parameters
    +
    5877  if (hsz == 124) {
    +
    5878  stbi__get32le(s); // discard rendering intent
    +
    5879  stbi__get32le(s); // discard offset of profile data
    +
    5880  stbi__get32le(s); // discard size of profile data
    +
    5881  stbi__get32le(s); // discard reserved
    +
    5882  }
    +
    5883  }
    +
    5884  }
    +
    5885  return (void *)1;
    +
    5886 }
    5887 
    -
    5888  chained = stbi__get8(s);
    -
    5889  packet->size = stbi__get8(s);
    -
    5890  packet->type = stbi__get8(s);
    -
    5891  packet->channel = stbi__get8(s);
    -
    5892 
    -
    5893  act_comp |= packet->channel;
    -
    5894 
    -
    5895  if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)");
    -
    5896  if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp");
    -
    5897  } while (chained);
    +
    5888 static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp,
    +
    5889  int req_comp, stbi__result_info *ri)
    +
    5890 {
    +
    5891  stbi_uc *out;
    +
    5892  unsigned int mr = 0, mg = 0, mb = 0, ma = 0, all_a;
    +
    5893  stbi_uc pal[256][4];
    +
    5894  int psize = 0, i, j, width;
    +
    5895  int flip_vertically, pad, target;
    +
    5896  stbi__bmp_data info;
    +
    5897  STBI_NOTUSED(ri);
    5898 
    -
    5899  *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
    -
    5900 
    -
    5901  for(y=0; y<height; ++y) {
    -
    5902  int packet_idx;
    -
    5903 
    -
    5904  for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
    -
    5905  stbi__pic_packet *packet = &packets[packet_idx];
    -
    5906  stbi_uc *dest = result+y*width*4;
    -
    5907 
    -
    5908  switch (packet->type) {
    -
    5909  default:
    -
    5910  return stbi__errpuc("bad format","packet has bad compression type");
    +
    5899  info.all_a = 255;
    +
    5900  if (stbi__bmp_parse_header(s, &info) == NULL)
    +
    5901  return NULL; // error code already set
    +
    5902 
    +
    5903  flip_vertically = ((int)s->img_y) > 0;
    +
    5904  s->img_y = abs((int)s->img_y);
    +
    5905 
    +
    5906  mr = info.mr;
    +
    5907  mg = info.mg;
    +
    5908  mb = info.mb;
    +
    5909  ma = info.ma;
    +
    5910  all_a = info.all_a;
    5911 
    -
    5912  case 0: {//uncompressed
    -
    5913  int x;
    -
    5914 
    -
    5915  for(x=0;x<width;++x, dest+=4)
    -
    5916  if (!stbi__readval(s,packet->channel,dest))
    -
    5917  return 0;
    -
    5918  break;
    -
    5919  }
    -
    5920 
    -
    5921  case 1://Pure RLE
    -
    5922  {
    -
    5923  int left=width, i;
    -
    5924 
    -
    5925  while (left>0) {
    -
    5926  stbi_uc count,value[4];
    -
    5927 
    -
    5928  count=stbi__get8(s);
    -
    5929  if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)");
    -
    5930 
    -
    5931  if (count > left)
    -
    5932  count = (stbi_uc) left;
    -
    5933 
    -
    5934  if (!stbi__readval(s,packet->channel,value)) return 0;
    -
    5935 
    -
    5936  for(i=0; i<count; ++i,dest+=4)
    -
    5937  stbi__copyval(packet->channel,dest,value);
    -
    5938  left -= count;
    -
    5939  }
    -
    5940  }
    -
    5941  break;
    -
    5942 
    -
    5943  case 2: {//Mixed RLE
    -
    5944  int left=width;
    -
    5945  while (left>0) {
    -
    5946  int count = stbi__get8(s), i;
    -
    5947  if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)");
    -
    5948 
    -
    5949  if (count >= 128) { // Repeated
    -
    5950  stbi_uc value[4];
    -
    5951 
    -
    5952  if (count==128)
    -
    5953  count = stbi__get16be(s);
    -
    5954  else
    -
    5955  count -= 127;
    -
    5956  if (count > left)
    -
    5957  return stbi__errpuc("bad file","scanline overrun");
    -
    5958 
    -
    5959  if (!stbi__readval(s,packet->channel,value))
    -
    5960  return 0;
    -
    5961 
    -
    5962  for(i=0;i<count;++i, dest += 4)
    -
    5963  stbi__copyval(packet->channel,dest,value);
    -
    5964  } else { // Raw
    -
    5965  ++count;
    -
    5966  if (count>left) return stbi__errpuc("bad file","scanline overrun");
    -
    5967 
    -
    5968  for(i=0;i<count;++i, dest+=4)
    -
    5969  if (!stbi__readval(s,packet->channel,dest))
    -
    5970  return 0;
    -
    5971  }
    -
    5972  left-=count;
    -
    5973  }
    -
    5974  break;
    -
    5975  }
    -
    5976  }
    -
    5977  }
    -
    5978  }
    -
    5979 
    -
    5980  return result;
    -
    5981 }
    -
    5982 
    -
    5983 static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp, stbi__result_info *ri)
    -
    5984 {
    -
    5985  stbi_uc *result;
    -
    5986  int i, x,y, internal_comp;
    -
    5987  STBI_NOTUSED(ri);
    -
    5988 
    -
    5989  if (!comp) comp = &internal_comp;
    -
    5990 
    -
    5991  for (i=0; i<92; ++i)
    -
    5992  stbi__get8(s);
    -
    5993 
    -
    5994  x = stbi__get16be(s);
    -
    5995  y = stbi__get16be(s);
    -
    5996  if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)");
    -
    5997  if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode");
    -
    5998 
    -
    5999  stbi__get32be(s); //skip `ratio'
    -
    6000  stbi__get16be(s); //skip `fields'
    -
    6001  stbi__get16be(s); //skip `pad'
    -
    6002 
    -
    6003  // intermediate buffer is RGBA
    -
    6004  result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);
    -
    6005  memset(result, 0xff, x*y*4);
    -
    6006 
    -
    6007  if (!stbi__pic_load_core(s,x,y,comp, result)) {
    -
    6008  STBI_FREE(result);
    -
    6009  result=0;
    -
    6010  }
    -
    6011  *px = x;
    -
    6012  *py = y;
    -
    6013  if (req_comp == 0) req_comp = *comp;
    -
    6014  result=stbi__convert_format(result,4,req_comp,x,y);
    -
    6015 
    -
    6016  return result;
    -
    6017 }
    -
    6018 
    -
    6019 static int stbi__pic_test(stbi__context *s)
    -
    6020 {
    -
    6021  int r = stbi__pic_test_core(s);
    -
    6022  stbi__rewind(s);
    -
    6023  return r;
    -
    6024 }
    -
    6025 #endif
    -
    6026 
    -
    6027 // *************************************************************************************************
    -
    6028 // GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
    -
    6029 
    -
    6030 #ifndef STBI_NO_GIF
    -
    6031 typedef struct
    -
    6032 {
    -
    6033  stbi__int16 prefix;
    -
    6034  stbi_uc first;
    -
    6035  stbi_uc suffix;
    -
    6036 } stbi__gif_lzw;
    -
    6037 
    -
    6038 typedef struct
    -
    6039 {
    -
    6040  int w,h;
    -
    6041  stbi_uc *out, *old_out; // output buffer (always 4 components)
    -
    6042  int flags, bgindex, ratio, transparent, eflags, delay;
    -
    6043  stbi_uc pal[256][4];
    -
    6044  stbi_uc lpal[256][4];
    -
    6045  stbi__gif_lzw codes[4096];
    -
    6046  stbi_uc *color_table;
    -
    6047  int parse, step;
    -
    6048  int lflags;
    -
    6049  int start_x, start_y;
    -
    6050  int max_x, max_y;
    -
    6051  int cur_x, cur_y;
    -
    6052  int line_size;
    -
    6053 } stbi__gif;
    -
    6054 
    -
    6055 static int stbi__gif_test_raw(stbi__context *s)
    -
    6056 {
    -
    6057  int sz;
    -
    6058  if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;
    -
    6059  sz = stbi__get8(s);
    -
    6060  if (sz != '9' && sz != '7') return 0;
    -
    6061  if (stbi__get8(s) != 'a') return 0;
    -
    6062  return 1;
    -
    6063 }
    -
    6064 
    -
    6065 static int stbi__gif_test(stbi__context *s)
    -
    6066 {
    -
    6067  int r = stbi__gif_test_raw(s);
    -
    6068  stbi__rewind(s);
    -
    6069  return r;
    -
    6070 }
    -
    6071 
    -
    6072 static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp)
    -
    6073 {
    -
    6074  int i;
    -
    6075  for (i=0; i < num_entries; ++i) {
    -
    6076  pal[i][2] = stbi__get8(s);
    -
    6077  pal[i][1] = stbi__get8(s);
    -
    6078  pal[i][0] = stbi__get8(s);
    -
    6079  pal[i][3] = transp == i ? 0 : 255;
    -
    6080  }
    -
    6081 }
    -
    6082 
    -
    6083 static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)
    -
    6084 {
    -
    6085  stbi_uc version;
    -
    6086  if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')
    -
    6087  return stbi__err("not GIF", "Corrupt GIF");
    -
    6088 
    -
    6089  version = stbi__get8(s);
    -
    6090  if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF");
    -
    6091  if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
    -
    6092 
    -
    6093  stbi__g_failure_reason = "";
    -
    6094  g->w = stbi__get16le(s);
    -
    6095  g->h = stbi__get16le(s);
    -
    6096  g->flags = stbi__get8(s);
    -
    6097  g->bgindex = stbi__get8(s);
    -
    6098  g->ratio = stbi__get8(s);
    -
    6099  g->transparent = -1;
    -
    6100 
    -
    6101  if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments
    -
    6102 
    -
    6103  if (is_info) return 1;
    -
    6104 
    -
    6105  if (g->flags & 0x80)
    -
    6106  stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
    -
    6107 
    -
    6108  return 1;
    -
    6109 }
    -
    6110 
    -
    6111 static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
    -
    6112 {
    -
    6113  stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif));
    -
    6114  if (!stbi__gif_header(s, g, comp, 1)) {
    -
    6115  STBI_FREE(g);
    -
    6116  stbi__rewind( s );
    -
    6117  return 0;
    -
    6118  }
    -
    6119  if (x) *x = g->w;
    -
    6120  if (y) *y = g->h;
    -
    6121  STBI_FREE(g);
    -
    6122  return 1;
    -
    6123 }
    -
    6124 
    -
    6125 static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
    -
    6126 {
    -
    6127  stbi_uc *p, *c;
    -
    6128 
    -
    6129  // recurse to decode the prefixes, since the linked-list is backwards,
    -
    6130  // and working backwards through an interleaved image would be nasty
    -
    6131  if (g->codes[code].prefix >= 0)
    -
    6132  stbi__out_gif_code(g, g->codes[code].prefix);
    -
    6133 
    -
    6134  if (g->cur_y >= g->max_y) return;
    -
    6135 
    -
    6136  p = &g->out[g->cur_x + g->cur_y];
    -
    6137  c = &g->color_table[g->codes[code].suffix * 4];
    -
    6138 
    -
    6139  if (c[3] >= 128) {
    -
    6140  p[0] = c[2];
    -
    6141  p[1] = c[1];
    -
    6142  p[2] = c[0];
    -
    6143  p[3] = c[3];
    -
    6144  }
    -
    6145  g->cur_x += 4;
    -
    6146 
    -
    6147  if (g->cur_x >= g->max_x) {
    -
    6148  g->cur_x = g->start_x;
    -
    6149  g->cur_y += g->step;
    -
    6150 
    -
    6151  while (g->cur_y >= g->max_y && g->parse > 0) {
    -
    6152  g->step = (1 << g->parse) * g->line_size;
    -
    6153  g->cur_y = g->start_y + (g->step >> 1);
    -
    6154  --g->parse;
    -
    6155  }
    -
    6156  }
    -
    6157 }
    -
    6158 
    -
    6159 static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
    -
    6160 {
    -
    6161  stbi_uc lzw_cs;
    -
    6162  stbi__int32 len, init_code;
    -
    6163  stbi__uint32 first;
    -
    6164  stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
    -
    6165  stbi__gif_lzw *p;
    -
    6166 
    -
    6167  lzw_cs = stbi__get8(s);
    -
    6168  if (lzw_cs > 12) return NULL;
    -
    6169  clear = 1 << lzw_cs;
    -
    6170  first = 1;
    -
    6171  codesize = lzw_cs + 1;
    -
    6172  codemask = (1 << codesize) - 1;
    -
    6173  bits = 0;
    -
    6174  valid_bits = 0;
    -
    6175  for (init_code = 0; init_code < clear; init_code++) {
    -
    6176  g->codes[init_code].prefix = -1;
    -
    6177  g->codes[init_code].first = (stbi_uc) init_code;
    -
    6178  g->codes[init_code].suffix = (stbi_uc) init_code;
    -
    6179  }
    -
    6180 
    -
    6181  // support no starting clear code
    -
    6182  avail = clear+2;
    -
    6183  oldcode = -1;
    -
    6184 
    -
    6185  len = 0;
    -
    6186  for(;;) {
    -
    6187  if (valid_bits < codesize) {
    -
    6188  if (len == 0) {
    -
    6189  len = stbi__get8(s); // start new block
    -
    6190  if (len == 0)
    -
    6191  return g->out;
    -
    6192  }
    -
    6193  --len;
    -
    6194  bits |= (stbi__int32) stbi__get8(s) << valid_bits;
    -
    6195  valid_bits += 8;
    -
    6196  } else {
    -
    6197  stbi__int32 code = bits & codemask;
    -
    6198  bits >>= codesize;
    -
    6199  valid_bits -= codesize;
    -
    6200  // @OPTIMIZE: is there some way we can accelerate the non-clear path?
    -
    6201  if (code == clear) { // clear code
    -
    6202  codesize = lzw_cs + 1;
    -
    6203  codemask = (1 << codesize) - 1;
    -
    6204  avail = clear + 2;
    -
    6205  oldcode = -1;
    -
    6206  first = 0;
    -
    6207  } else if (code == clear + 1) { // end of stream code
    -
    6208  stbi__skip(s, len);
    -
    6209  while ((len = stbi__get8(s)) > 0)
    -
    6210  stbi__skip(s,len);
    -
    6211  return g->out;
    -
    6212  } else if (code <= avail) {
    -
    6213  if (first) return stbi__errpuc("no clear code", "Corrupt GIF");
    +
    5912  if (info.hsz == 12) {
    +
    5913  if (info.bpp < 24)
    +
    5914  psize = (info.offset - 14 - 24) / 3;
    +
    5915  } else {
    +
    5916  if (info.bpp < 16)
    +
    5917  psize = (info.offset - 14 - info.hsz) >> 2;
    +
    5918  }
    +
    5919 
    +
    5920  s->img_n = ma ? 4 : 3;
    +
    5921  if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
    +
    5922  target = req_comp;
    +
    5923  else
    +
    5924  target = s->img_n; // if they want monochrome, we'll post-convert
    +
    5925 
    +
    5926  // sanity-check size
    +
    5927  if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0))
    +
    5928  return stbi__errpuc("too large", "Corrupt BMP");
    +
    5929 
    +
    5930  out = (stbi_uc *)stbi__malloc_mad3(target, s->img_x, s->img_y, 0);
    +
    5931  if (!out)
    +
    5932  return stbi__errpuc("outofmem", "Out of memory");
    +
    5933  if (info.bpp < 16) {
    +
    5934  int z = 0;
    +
    5935  if (psize == 0 || psize > 256) {
    +
    5936  STBI_FREE(out);
    +
    5937  return stbi__errpuc("invalid", "Corrupt BMP");
    +
    5938  }
    +
    5939  for (i = 0; i < psize; ++i) {
    +
    5940  pal[i][2] = stbi__get8(s);
    +
    5941  pal[i][1] = stbi__get8(s);
    +
    5942  pal[i][0] = stbi__get8(s);
    +
    5943  if (info.hsz != 12)
    +
    5944  stbi__get8(s);
    +
    5945  pal[i][3] = 255;
    +
    5946  }
    +
    5947  stbi__skip(s, info.offset - 14 - info.hsz -
    +
    5948  psize * (info.hsz == 12 ? 3 : 4));
    +
    5949  if (info.bpp == 4)
    +
    5950  width = (s->img_x + 1) >> 1;
    +
    5951  else if (info.bpp == 8)
    +
    5952  width = s->img_x;
    +
    5953  else {
    +
    5954  STBI_FREE(out);
    +
    5955  return stbi__errpuc("bad bpp", "Corrupt BMP");
    +
    5956  }
    +
    5957  pad = (-width) & 3;
    +
    5958  for (j = 0; j < (int)s->img_y; ++j) {
    +
    5959  for (i = 0; i < (int)s->img_x; i += 2) {
    +
    5960  int v = stbi__get8(s), v2 = 0;
    +
    5961  if (info.bpp == 4) {
    +
    5962  v2 = v & 15;
    +
    5963  v >>= 4;
    +
    5964  }
    +
    5965  out[z++] = pal[v][0];
    +
    5966  out[z++] = pal[v][1];
    +
    5967  out[z++] = pal[v][2];
    +
    5968  if (target == 4)
    +
    5969  out[z++] = 255;
    +
    5970  if (i + 1 == (int)s->img_x)
    +
    5971  break;
    +
    5972  v = (info.bpp == 8) ? stbi__get8(s) : v2;
    +
    5973  out[z++] = pal[v][0];
    +
    5974  out[z++] = pal[v][1];
    +
    5975  out[z++] = pal[v][2];
    +
    5976  if (target == 4)
    +
    5977  out[z++] = 255;
    +
    5978  }
    +
    5979  stbi__skip(s, pad);
    +
    5980  }
    +
    5981  } else {
    +
    5982  int rshift = 0, gshift = 0, bshift = 0, ashift = 0, rcount = 0,
    +
    5983  gcount = 0, bcount = 0, acount = 0;
    +
    5984  int z = 0;
    +
    5985  int easy = 0;
    +
    5986  stbi__skip(s, info.offset - 14 - info.hsz);
    +
    5987  if (info.bpp == 24)
    +
    5988  width = 3 * s->img_x;
    +
    5989  else if (info.bpp == 16)
    +
    5990  width = 2 * s->img_x;
    +
    5991  else /* bpp = 32 and pad = 0 */
    +
    5992  width = 0;
    +
    5993  pad = (-width) & 3;
    +
    5994  if (info.bpp == 24) {
    +
    5995  easy = 1;
    +
    5996  } else if (info.bpp == 32) {
    +
    5997  if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 &&
    +
    5998  ma == 0xff000000)
    +
    5999  easy = 2;
    +
    6000  }
    +
    6001  if (!easy) {
    +
    6002  if (!mr || !mg || !mb) {
    +
    6003  STBI_FREE(out);
    +
    6004  return stbi__errpuc("bad masks", "Corrupt BMP");
    +
    6005  }
    +
    6006  // right shift amt to put high bit in position #7
    +
    6007  rshift = stbi__high_bit(mr) - 7;
    +
    6008  rcount = stbi__bitcount(mr);
    +
    6009  gshift = stbi__high_bit(mg) - 7;
    +
    6010  gcount = stbi__bitcount(mg);
    +
    6011  bshift = stbi__high_bit(mb) - 7;
    +
    6012  bcount = stbi__bitcount(mb);
    +
    6013  ashift = stbi__high_bit(ma) - 7;
    +
    6014  acount = stbi__bitcount(ma);
    +
    6015  }
    +
    6016  for (j = 0; j < (int)s->img_y; ++j) {
    +
    6017  if (easy) {
    +
    6018  for (i = 0; i < (int)s->img_x; ++i) {
    +
    6019  unsigned char a;
    +
    6020  out[z + 2] = stbi__get8(s);
    +
    6021  out[z + 1] = stbi__get8(s);
    +
    6022  out[z + 0] = stbi__get8(s);
    +
    6023  z += 3;
    +
    6024  a = (easy == 2 ? stbi__get8(s) : 255);
    +
    6025  all_a |= a;
    +
    6026  if (target == 4)
    +
    6027  out[z++] = a;
    +
    6028  }
    +
    6029  } else {
    +
    6030  int bpp = info.bpp;
    +
    6031  for (i = 0; i < (int)s->img_x; ++i) {
    +
    6032  stbi__uint32 v = (bpp == 16 ? (stbi__uint32)stbi__get16le(s)
    +
    6033  : stbi__get32le(s));
    +
    6034  int a;
    +
    6035  out[z++] = STBI__BYTECAST(
    +
    6036  stbi__shiftsigned(v & mr, rshift, rcount));
    +
    6037  out[z++] = STBI__BYTECAST(
    +
    6038  stbi__shiftsigned(v & mg, gshift, gcount));
    +
    6039  out[z++] = STBI__BYTECAST(
    +
    6040  stbi__shiftsigned(v & mb, bshift, bcount));
    +
    6041  a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);
    +
    6042  all_a |= a;
    +
    6043  if (target == 4)
    +
    6044  out[z++] = STBI__BYTECAST(a);
    +
    6045  }
    +
    6046  }
    +
    6047  stbi__skip(s, pad);
    +
    6048  }
    +
    6049  }
    +
    6050 
    +
    6051  // if alpha channel is all 0s, replace with all 255s
    +
    6052  if (target == 4 && all_a == 0)
    +
    6053  for (i = 4 * s->img_x * s->img_y - 1; i >= 0; i -= 4)
    +
    6054  out[i] = 255;
    +
    6055 
    +
    6056  if (flip_vertically) {
    +
    6057  stbi_uc t;
    +
    6058  for (j = 0; j<(int)s->img_y>> 1; ++j) {
    +
    6059  stbi_uc *p1 = out + j * s->img_x * target;
    +
    6060  stbi_uc *p2 = out + (s->img_y - 1 - j) * s->img_x * target;
    +
    6061  for (i = 0; i < (int)s->img_x * target; ++i) {
    +
    6062  t = p1[i], p1[i] = p2[i], p2[i] = t;
    +
    6063  }
    +
    6064  }
    +
    6065  }
    +
    6066 
    +
    6067  if (req_comp && req_comp != target) {
    +
    6068  out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
    +
    6069  if (out == NULL)
    +
    6070  return out; // stbi__convert_format frees input on failure
    +
    6071  }
    +
    6072 
    +
    6073  *x = s->img_x;
    +
    6074  *y = s->img_y;
    +
    6075  if (comp)
    +
    6076  *comp = s->img_n;
    +
    6077  return out;
    +
    6078 }
    +
    6079 #endif
    +
    6080 
    +
    6081 // Targa Truevision - TGA
    +
    6082 // by Jonathan Dummer
    +
    6083 #ifndef STBI_NO_TGA
    +
    6084 // returns STBI_rgb or whatever, 0 on error
    +
    6085 static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int *is_rgb16)
    +
    6086 {
    +
    6087  // only RGB or RGBA (incl. 16bit) or grey allowed
    +
    6088  if (is_rgb16)
    +
    6089  *is_rgb16 = 0;
    +
    6090  switch (bits_per_pixel) {
    +
    6091  case 8:
    +
    6092  return STBI_grey;
    +
    6093  case 16:
    +
    6094  if (is_grey)
    +
    6095  return STBI_grey_alpha;
    +
    6096  // else: fall-through
    +
    6097  case 15:
    +
    6098  if (is_rgb16)
    +
    6099  *is_rgb16 = 1;
    +
    6100  return STBI_rgb;
    +
    6101  case 24: // fall-through
    +
    6102  case 32:
    +
    6103  return bits_per_pixel / 8;
    +
    6104  default:
    +
    6105  return 0;
    +
    6106  }
    +
    6107 }
    +
    6108 
    +
    6109 static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
    +
    6110 {
    +
    6111  int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel,
    +
    6112  tga_colormap_bpp;
    +
    6113  int sz, tga_colormap_type;
    +
    6114  stbi__get8(s); // discard Offset
    +
    6115  tga_colormap_type = stbi__get8(s); // colormap type
    +
    6116  if (tga_colormap_type > 1) {
    +
    6117  stbi__rewind(s);
    +
    6118  return 0; // only RGB or indexed allowed
    +
    6119  }
    +
    6120  tga_image_type = stbi__get8(s); // image type
    +
    6121  if (tga_colormap_type == 1) { // colormapped (paletted) image
    +
    6122  if (tga_image_type != 1 && tga_image_type != 9) {
    +
    6123  stbi__rewind(s);
    +
    6124  return 0;
    +
    6125  }
    +
    6126  stbi__skip(
    +
    6127  s, 4); // skip index of first colormap entry and number of entries
    +
    6128  sz = stbi__get8(s); // check bits per palette color entry
    +
    6129  if ((sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32)) {
    +
    6130  stbi__rewind(s);
    +
    6131  return 0;
    +
    6132  }
    +
    6133  stbi__skip(s, 4); // skip image x and y origin
    +
    6134  tga_colormap_bpp = sz;
    +
    6135  } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE
    +
    6136  if ((tga_image_type != 2) && (tga_image_type != 3) &&
    +
    6137  (tga_image_type != 10) && (tga_image_type != 11)) {
    +
    6138  stbi__rewind(s);
    +
    6139  return 0; // only RGB or grey allowed, +/- RLE
    +
    6140  }
    +
    6141  stbi__skip(s, 9); // skip colormap specification and image x/y origin
    +
    6142  tga_colormap_bpp = 0;
    +
    6143  }
    +
    6144  tga_w = stbi__get16le(s);
    +
    6145  if (tga_w < 1) {
    +
    6146  stbi__rewind(s);
    +
    6147  return 0; // test width
    +
    6148  }
    +
    6149  tga_h = stbi__get16le(s);
    +
    6150  if (tga_h < 1) {
    +
    6151  stbi__rewind(s);
    +
    6152  return 0; // test height
    +
    6153  }
    +
    6154  tga_bits_per_pixel = stbi__get8(s); // bits per pixel
    +
    6155  stbi__get8(s); // ignore alpha bits
    +
    6156  if (tga_colormap_bpp != 0) {
    +
    6157  if ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) {
    +
    6158  // when using a colormap, tga_bits_per_pixel is the size of the
    +
    6159  // indexes I don't think anything but 8 or 16bit indexes makes sense
    +
    6160  stbi__rewind(s);
    +
    6161  return 0;
    +
    6162  }
    +
    6163  tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL);
    +
    6164  } else {
    +
    6165  tga_comp = stbi__tga_get_comp(
    +
    6166  tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11),
    +
    6167  NULL);
    +
    6168  }
    +
    6169  if (!tga_comp) {
    +
    6170  stbi__rewind(s);
    +
    6171  return 0;
    +
    6172  }
    +
    6173  if (x)
    +
    6174  *x = tga_w;
    +
    6175  if (y)
    +
    6176  *y = tga_h;
    +
    6177  if (comp)
    +
    6178  *comp = tga_comp;
    +
    6179  return 1; // seems to have passed everything
    +
    6180 }
    +
    6181 
    +
    6182 static int stbi__tga_test(stbi__context *s)
    +
    6183 {
    +
    6184  int res = 0;
    +
    6185  int sz, tga_color_type;
    +
    6186  stbi__get8(s); // discard Offset
    +
    6187  tga_color_type = stbi__get8(s); // color type
    +
    6188  if (tga_color_type > 1)
    +
    6189  goto errorEnd; // only RGB or indexed allowed
    +
    6190  sz = stbi__get8(s); // image type
    +
    6191  if (tga_color_type == 1) { // colormapped (paletted) image
    +
    6192  if (sz != 1 && sz != 9)
    +
    6193  goto errorEnd; // colortype 1 demands image type 1 or 9
    +
    6194  stbi__skip(
    +
    6195  s, 4); // skip index of first colormap entry and number of entries
    +
    6196  sz = stbi__get8(s); // check bits per palette color entry
    +
    6197  if ((sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32))
    +
    6198  goto errorEnd;
    +
    6199  stbi__skip(s, 4); // skip image x and y origin
    +
    6200  } else { // "normal" image w/o colormap
    +
    6201  if ((sz != 2) && (sz != 3) && (sz != 10) && (sz != 11))
    +
    6202  goto errorEnd; // only RGB or grey allowed, +/- RLE
    +
    6203  stbi__skip(s, 9); // skip colormap specification and image x/y origin
    +
    6204  }
    +
    6205  if (stbi__get16le(s) < 1)
    +
    6206  goto errorEnd; // test width
    +
    6207  if (stbi__get16le(s) < 1)
    +
    6208  goto errorEnd; // test height
    +
    6209  sz = stbi__get8(s); // bits per pixel
    +
    6210  if ((tga_color_type == 1) && (sz != 8) && (sz != 16))
    +
    6211  goto errorEnd; // for colormapped images, bpp is size of an index
    +
    6212  if ((sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32))
    +
    6213  goto errorEnd;
    6214 
    -
    6215  if (oldcode >= 0) {
    -
    6216  p = &g->codes[avail++];
    -
    6217  if (avail > 4096) return stbi__errpuc("too many codes", "Corrupt GIF");
    -
    6218  p->prefix = (stbi__int16) oldcode;
    -
    6219  p->first = g->codes[oldcode].first;
    -
    6220  p->suffix = (code == avail) ? p->first : g->codes[code].first;
    -
    6221  } else if (code == avail)
    -
    6222  return stbi__errpuc("illegal code in raster", "Corrupt GIF");
    -
    6223 
    -
    6224  stbi__out_gif_code(g, (stbi__uint16) code);
    -
    6225 
    -
    6226  if ((avail & codemask) == 0 && avail <= 0x0FFF) {
    -
    6227  codesize++;
    -
    6228  codemask = (1 << codesize) - 1;
    -
    6229  }
    -
    6230 
    -
    6231  oldcode = code;
    -
    6232  } else {
    -
    6233  return stbi__errpuc("illegal code in raster", "Corrupt GIF");
    -
    6234  }
    -
    6235  }
    -
    6236  }
    -
    6237 }
    -
    6238 
    -
    6239 static void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1, int y1)
    -
    6240 {
    -
    6241  int x, y;
    -
    6242  stbi_uc *c = g->pal[g->bgindex];
    -
    6243  for (y = y0; y < y1; y += 4 * g->w) {
    -
    6244  for (x = x0; x < x1; x += 4) {
    -
    6245  stbi_uc *p = &g->out[y + x];
    -
    6246  p[0] = c[2];
    -
    6247  p[1] = c[1];
    -
    6248  p[2] = c[0];
    -
    6249  p[3] = 0;
    -
    6250  }
    -
    6251  }
    -
    6252 }
    -
    6253 
    -
    6254 // this function is designed to support animated gifs, although stb_image doesn't support it
    -
    6255 static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp)
    -
    6256 {
    -
    6257  int i;
    -
    6258  stbi_uc *prev_out = 0;
    -
    6259 
    -
    6260  if (g->out == 0 && !stbi__gif_header(s, g, comp,0))
    -
    6261  return 0; // stbi__g_failure_reason set by stbi__gif_header
    -
    6262 
    -
    6263  if (!stbi__mad3sizes_valid(g->w, g->h, 4, 0))
    -
    6264  return stbi__errpuc("too large", "GIF too large");
    -
    6265 
    -
    6266  prev_out = g->out;
    -
    6267  g->out = (stbi_uc *) stbi__malloc_mad3(4, g->w, g->h, 0);
    -
    6268  if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
    -
    6269 
    -
    6270  switch ((g->eflags & 0x1C) >> 2) {
    -
    6271  case 0: // unspecified (also always used on 1st frame)
    -
    6272  stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h);
    -
    6273  break;
    -
    6274  case 1: // do not dispose
    -
    6275  if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h);
    -
    6276  g->old_out = prev_out;
    -
    6277  break;
    -
    6278  case 2: // dispose to background
    -
    6279  if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h);
    -
    6280  stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x, g->max_y);
    -
    6281  break;
    -
    6282  case 3: // dispose to previous
    -
    6283  if (g->old_out) {
    -
    6284  for (i = g->start_y; i < g->max_y; i += 4 * g->w)
    -
    6285  memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x], g->max_x - g->start_x);
    -
    6286  }
    -
    6287  break;
    -
    6288  }
    -
    6289 
    -
    6290  for (;;) {
    -
    6291  switch (stbi__get8(s)) {
    -
    6292  case 0x2C: /* Image Descriptor */
    -
    6293  {
    -
    6294  int prev_trans = -1;
    -
    6295  stbi__int32 x, y, w, h;
    -
    6296  stbi_uc *o;
    +
    6215  res = 1; // if we got this far, everything's good and we can return 1
    +
    6216  // instead of 0
    +
    6217 
    +
    6218 errorEnd:
    +
    6219  stbi__rewind(s);
    +
    6220  return res;
    +
    6221 }
    +
    6222 
    +
    6223 // read 16bit value and convert to 24bit RGB
    +
    6224 static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc *out)
    +
    6225 {
    +
    6226  stbi__uint16 px = (stbi__uint16)stbi__get16le(s);
    +
    6227  stbi__uint16 fiveBitMask = 31;
    +
    6228  // we have 3 channels with 5bits each
    +
    6229  int r = (px >> 10) & fiveBitMask;
    +
    6230  int g = (px >> 5) & fiveBitMask;
    +
    6231  int b = px & fiveBitMask;
    +
    6232  // Note that this saves the data in RGB(A) order, so it doesn't need to be
    +
    6233  // swapped later
    +
    6234  out[0] = (stbi_uc)((r * 255) / 31);
    +
    6235  out[1] = (stbi_uc)((g * 255) / 31);
    +
    6236  out[2] = (stbi_uc)((b * 255) / 31);
    +
    6237 
    +
    6238  // some people claim that the most significant bit might be used for alpha
    +
    6239  // (possibly if an alpha-bit is set in the "image descriptor byte")
    +
    6240  // but that only made 16bit test images completely translucent..
    +
    6241  // so let's treat all 15 and 16bit TGAs as RGB with no alpha.
    +
    6242 }
    +
    6243 
    +
    6244 static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp,
    +
    6245  int req_comp, stbi__result_info *ri)
    +
    6246 {
    +
    6247  // read in the TGA header stuff
    +
    6248  int tga_offset = stbi__get8(s);
    +
    6249  int tga_indexed = stbi__get8(s);
    +
    6250  int tga_image_type = stbi__get8(s);
    +
    6251  int tga_is_RLE = 0;
    +
    6252  int tga_palette_start = stbi__get16le(s);
    +
    6253  int tga_palette_len = stbi__get16le(s);
    +
    6254  int tga_palette_bits = stbi__get8(s);
    +
    6255  int tga_x_origin = stbi__get16le(s);
    +
    6256  int tga_y_origin = stbi__get16le(s);
    +
    6257  int tga_width = stbi__get16le(s);
    +
    6258  int tga_height = stbi__get16le(s);
    +
    6259  int tga_bits_per_pixel = stbi__get8(s);
    +
    6260  int tga_comp, tga_rgb16 = 0;
    +
    6261  int tga_inverted = stbi__get8(s);
    +
    6262  // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused
    +
    6263  // (useless?)
    +
    6264  // image data
    +
    6265  unsigned char *tga_data;
    +
    6266  unsigned char *tga_palette = NULL;
    +
    6267  int i, j;
    +
    6268  unsigned char raw_data[4] = {0};
    +
    6269  int RLE_count = 0;
    +
    6270  int RLE_repeating = 0;
    +
    6271  int read_next_pixel = 1;
    +
    6272  STBI_NOTUSED(ri);
    +
    6273 
    +
    6274  // do a tiny bit of precessing
    +
    6275  if (tga_image_type >= 8) {
    +
    6276  tga_image_type -= 8;
    +
    6277  tga_is_RLE = 1;
    +
    6278  }
    +
    6279  tga_inverted = 1 - ((tga_inverted >> 5) & 1);
    +
    6280 
    +
    6281  // If I'm paletted, then I'll use the number of bits from the palette
    +
    6282  if (tga_indexed)
    +
    6283  tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);
    +
    6284  else
    +
    6285  tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3),
    +
    6286  &tga_rgb16);
    +
    6287 
    +
    6288  if (!tga_comp) // shouldn't really happen, stbi__tga_test() should have
    +
    6289  // ensured basic consistency
    +
    6290  return stbi__errpuc("bad format", "Can't find out TGA pixelformat");
    +
    6291 
    +
    6292  // tga info
    +
    6293  *x = tga_width;
    +
    6294  *y = tga_height;
    +
    6295  if (comp)
    +
    6296  *comp = tga_comp;
    6297 
    -
    6298  x = stbi__get16le(s);
    -
    6299  y = stbi__get16le(s);
    -
    6300  w = stbi__get16le(s);
    -
    6301  h = stbi__get16le(s);
    -
    6302  if (((x + w) > (g->w)) || ((y + h) > (g->h)))
    -
    6303  return stbi__errpuc("bad Image Descriptor", "Corrupt GIF");
    -
    6304 
    -
    6305  g->line_size = g->w * 4;
    -
    6306  g->start_x = x * 4;
    -
    6307  g->start_y = y * g->line_size;
    -
    6308  g->max_x = g->start_x + w * 4;
    -
    6309  g->max_y = g->start_y + h * g->line_size;
    -
    6310  g->cur_x = g->start_x;
    -
    6311  g->cur_y = g->start_y;
    -
    6312 
    -
    6313  g->lflags = stbi__get8(s);
    -
    6314 
    -
    6315  if (g->lflags & 0x40) {
    -
    6316  g->step = 8 * g->line_size; // first interlaced spacing
    -
    6317  g->parse = 3;
    -
    6318  } else {
    -
    6319  g->step = g->line_size;
    -
    6320  g->parse = 0;
    -
    6321  }
    -
    6322 
    -
    6323  if (g->lflags & 0x80) {
    -
    6324  stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
    -
    6325  g->color_table = (stbi_uc *) g->lpal;
    -
    6326  } else if (g->flags & 0x80) {
    -
    6327  if (g->transparent >= 0 && (g->eflags & 0x01)) {
    -
    6328  prev_trans = g->pal[g->transparent][3];
    -
    6329  g->pal[g->transparent][3] = 0;
    -
    6330  }
    -
    6331  g->color_table = (stbi_uc *) g->pal;
    -
    6332  } else
    -
    6333  return stbi__errpuc("missing color table", "Corrupt GIF");
    -
    6334 
    -
    6335  o = stbi__process_gif_raster(s, g);
    -
    6336  if (o == NULL) return NULL;
    -
    6337 
    -
    6338  if (prev_trans != -1)
    -
    6339  g->pal[g->transparent][3] = (stbi_uc) prev_trans;
    -
    6340 
    -
    6341  return o;
    -
    6342  }
    -
    6343 
    -
    6344  case 0x21: // Comment Extension.
    -
    6345  {
    -
    6346  int len;
    -
    6347  if (stbi__get8(s) == 0xF9) { // Graphic Control Extension.
    -
    6348  len = stbi__get8(s);
    -
    6349  if (len == 4) {
    -
    6350  g->eflags = stbi__get8(s);
    -
    6351  g->delay = stbi__get16le(s);
    -
    6352  g->transparent = stbi__get8(s);
    -
    6353  } else {
    -
    6354  stbi__skip(s, len);
    -
    6355  break;
    -
    6356  }
    -
    6357  }
    -
    6358  while ((len = stbi__get8(s)) != 0)
    -
    6359  stbi__skip(s, len);
    -
    6360  break;
    -
    6361  }
    -
    6362 
    -
    6363  case 0x3B: // gif stream termination code
    -
    6364  return (stbi_uc *) s; // using '1' causes warning on some compilers
    -
    6365 
    -
    6366  default:
    -
    6367  return stbi__errpuc("unknown code", "Corrupt GIF");
    -
    6368  }
    -
    6369  }
    -
    6370 
    -
    6371  STBI_NOTUSED(req_comp);
    -
    6372 }
    -
    6373 
    -
    6374 static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    6375 {
    -
    6376  stbi_uc *u = 0;
    -
    6377  stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif));
    -
    6378  memset(g, 0, sizeof(*g));
    -
    6379  STBI_NOTUSED(ri);
    -
    6380 
    -
    6381  u = stbi__gif_load_next(s, g, comp, req_comp);
    -
    6382  if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
    -
    6383  if (u) {
    -
    6384  *x = g->w;
    -
    6385  *y = g->h;
    -
    6386  if (req_comp && req_comp != 4)
    -
    6387  u = stbi__convert_format(u, 4, req_comp, g->w, g->h);
    -
    6388  }
    -
    6389  else if (g->out)
    -
    6390  STBI_FREE(g->out);
    -
    6391  STBI_FREE(g);
    -
    6392  return u;
    -
    6393 }
    -
    6394 
    -
    6395 static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6396 {
    -
    6397  return stbi__gif_info_raw(s,x,y,comp);
    -
    6398 }
    -
    6399 #endif
    -
    6400 
    -
    6401 // *************************************************************************************************
    -
    6402 // Radiance RGBE HDR loader
    -
    6403 // originally by Nicolas Schulz
    -
    6404 #ifndef STBI_NO_HDR
    -
    6405 static int stbi__hdr_test_core(stbi__context *s, const char *signature)
    -
    6406 {
    -
    6407  int i;
    -
    6408  for (i=0; signature[i]; ++i)
    -
    6409  if (stbi__get8(s) != signature[i])
    -
    6410  return 0;
    -
    6411  stbi__rewind(s);
    -
    6412  return 1;
    -
    6413 }
    -
    6414 
    -
    6415 static int stbi__hdr_test(stbi__context* s)
    -
    6416 {
    -
    6417  int r = stbi__hdr_test_core(s, "#?RADIANCE\n");
    -
    6418  stbi__rewind(s);
    -
    6419  if(!r) {
    -
    6420  r = stbi__hdr_test_core(s, "#?RGBE\n");
    -
    6421  stbi__rewind(s);
    -
    6422  }
    -
    6423  return r;
    -
    6424 }
    -
    6425 
    -
    6426 #define STBI__HDR_BUFLEN 1024
    -
    6427 static char *stbi__hdr_gettoken(stbi__context *z, char *buffer)
    -
    6428 {
    -
    6429  int len=0;
    -
    6430  char c = '\0';
    -
    6431 
    -
    6432  c = (char) stbi__get8(z);
    -
    6433 
    -
    6434  while (!stbi__at_eof(z) && c != '\n') {
    -
    6435  buffer[len++] = c;
    -
    6436  if (len == STBI__HDR_BUFLEN-1) {
    -
    6437  // flush to end of line
    -
    6438  while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
    -
    6439  ;
    -
    6440  break;
    -
    6441  }
    -
    6442  c = (char) stbi__get8(z);
    -
    6443  }
    -
    6444 
    -
    6445  buffer[len] = 0;
    -
    6446  return buffer;
    +
    6298  if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0))
    +
    6299  return stbi__errpuc("too large", "Corrupt TGA");
    +
    6300 
    +
    6301  tga_data =
    +
    6302  (unsigned char *)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0);
    +
    6303  if (!tga_data)
    +
    6304  return stbi__errpuc("outofmem", "Out of memory");
    +
    6305 
    +
    6306  // skip to the data's starting position (offset usually = 0)
    +
    6307  stbi__skip(s, tga_offset);
    +
    6308 
    +
    6309  if (!tga_indexed && !tga_is_RLE && !tga_rgb16) {
    +
    6310  for (i = 0; i < tga_height; ++i) {
    +
    6311  int row = tga_inverted ? tga_height - i - 1 : i;
    +
    6312  stbi_uc *tga_row = tga_data + row * tga_width * tga_comp;
    +
    6313  stbi__getn(s, tga_row, tga_width * tga_comp);
    +
    6314  }
    +
    6315  } else {
    +
    6316  // do I need to load a palette?
    +
    6317  if (tga_indexed) {
    +
    6318  // any data to skip? (offset usually = 0)
    +
    6319  stbi__skip(s, tga_palette_start);
    +
    6320  // load the palette
    +
    6321  tga_palette = (unsigned char *)stbi__malloc_mad2(tga_palette_len,
    +
    6322  tga_comp, 0);
    +
    6323  if (!tga_palette) {
    +
    6324  STBI_FREE(tga_data);
    +
    6325  return stbi__errpuc("outofmem", "Out of memory");
    +
    6326  }
    +
    6327  if (tga_rgb16) {
    +
    6328  stbi_uc *pal_entry = tga_palette;
    +
    6329  STBI_ASSERT(tga_comp == STBI_rgb);
    +
    6330  for (i = 0; i < tga_palette_len; ++i) {
    +
    6331  stbi__tga_read_rgb16(s, pal_entry);
    +
    6332  pal_entry += tga_comp;
    +
    6333  }
    +
    6334  } else if (!stbi__getn(s, tga_palette,
    +
    6335  tga_palette_len * tga_comp)) {
    +
    6336  STBI_FREE(tga_data);
    +
    6337  STBI_FREE(tga_palette);
    +
    6338  return stbi__errpuc("bad palette", "Corrupt TGA");
    +
    6339  }
    +
    6340  }
    +
    6341  // load the data
    +
    6342  for (i = 0; i < tga_width * tga_height; ++i) {
    +
    6343  // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
    +
    6344  if (tga_is_RLE) {
    +
    6345  if (RLE_count == 0) {
    +
    6346  // yep, get the next byte as a RLE command
    +
    6347  int RLE_cmd = stbi__get8(s);
    +
    6348  RLE_count = 1 + (RLE_cmd & 127);
    +
    6349  RLE_repeating = RLE_cmd >> 7;
    +
    6350  read_next_pixel = 1;
    +
    6351  } else if (!RLE_repeating) {
    +
    6352  read_next_pixel = 1;
    +
    6353  }
    +
    6354  } else {
    +
    6355  read_next_pixel = 1;
    +
    6356  }
    +
    6357  // OK, if I need to read a pixel, do it now
    +
    6358  if (read_next_pixel) {
    +
    6359  // load however much data we did have
    +
    6360  if (tga_indexed) {
    +
    6361  // read in index, then perform the lookup
    +
    6362  int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s)
    +
    6363  : stbi__get16le(s);
    +
    6364  if (pal_idx >= tga_palette_len) {
    +
    6365  // invalid index
    +
    6366  pal_idx = 0;
    +
    6367  }
    +
    6368  pal_idx *= tga_comp;
    +
    6369  for (j = 0; j < tga_comp; ++j) {
    +
    6370  raw_data[j] = tga_palette[pal_idx + j];
    +
    6371  }
    +
    6372  } else if (tga_rgb16) {
    +
    6373  STBI_ASSERT(tga_comp == STBI_rgb);
    +
    6374  stbi__tga_read_rgb16(s, raw_data);
    +
    6375  } else {
    +
    6376  // read in the data raw
    +
    6377  for (j = 0; j < tga_comp; ++j) {
    +
    6378  raw_data[j] = stbi__get8(s);
    +
    6379  }
    +
    6380  }
    +
    6381  // clear the reading flag for the next pixel
    +
    6382  read_next_pixel = 0;
    +
    6383  } // end of reading a pixel
    +
    6384 
    +
    6385  // copy data
    +
    6386  for (j = 0; j < tga_comp; ++j)
    +
    6387  tga_data[i * tga_comp + j] = raw_data[j];
    +
    6388 
    +
    6389  // in case we're in RLE mode, keep counting down
    +
    6390  --RLE_count;
    +
    6391  }
    +
    6392  // do I need to invert the image?
    +
    6393  if (tga_inverted) {
    +
    6394  for (j = 0; j * 2 < tga_height; ++j) {
    +
    6395  int index1 = j * tga_width * tga_comp;
    +
    6396  int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
    +
    6397  for (i = tga_width * tga_comp; i > 0; --i) {
    +
    6398  unsigned char temp = tga_data[index1];
    +
    6399  tga_data[index1] = tga_data[index2];
    +
    6400  tga_data[index2] = temp;
    +
    6401  ++index1;
    +
    6402  ++index2;
    +
    6403  }
    +
    6404  }
    +
    6405  }
    +
    6406  // clear my palette, if I had one
    +
    6407  if (tga_palette != NULL) {
    +
    6408  STBI_FREE(tga_palette);
    +
    6409  }
    +
    6410  }
    +
    6411 
    +
    6412  // swap RGB - if the source data was RGB16, it already is in the right order
    +
    6413  if (tga_comp >= 3 && !tga_rgb16) {
    +
    6414  unsigned char *tga_pixel = tga_data;
    +
    6415  for (i = 0; i < tga_width * tga_height; ++i) {
    +
    6416  unsigned char temp = tga_pixel[0];
    +
    6417  tga_pixel[0] = tga_pixel[2];
    +
    6418  tga_pixel[2] = temp;
    +
    6419  tga_pixel += tga_comp;
    +
    6420  }
    +
    6421  }
    +
    6422 
    +
    6423  // convert to target component count
    +
    6424  if (req_comp && req_comp != tga_comp)
    +
    6425  tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width,
    +
    6426  tga_height);
    +
    6427 
    +
    6428  // the things I do to get rid of an error message, and yet keep
    +
    6429  // Microsoft's C compilers happy... [8^(
    +
    6430  tga_palette_start = tga_palette_len = tga_palette_bits = tga_x_origin =
    +
    6431  tga_y_origin = 0;
    +
    6432  // OK, done
    +
    6433  return tga_data;
    +
    6434 }
    +
    6435 #endif
    +
    6436 
    +
    6437  // *************************************************************************************************
    +
    6438  // Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas
    +
    6439  // Schulz, tweaked by STB
    +
    6440 
    +
    6441 #ifndef STBI_NO_PSD
    +
    6442 static int stbi__psd_test(stbi__context *s)
    +
    6443 {
    +
    6444  int r = (stbi__get32be(s) == 0x38425053);
    +
    6445  stbi__rewind(s);
    +
    6446  return r;
    6447 }
    6448 
    -
    6449 static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
    +
    6449 static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount)
    6450 {
    -
    6451  if ( input[3] != 0 ) {
    -
    6452  float f1;
    -
    6453  // Exponent
    -
    6454  f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
    -
    6455  if (req_comp <= 2)
    -
    6456  output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
    -
    6457  else {
    -
    6458  output[0] = input[0] * f1;
    -
    6459  output[1] = input[1] * f1;
    -
    6460  output[2] = input[2] * f1;
    -
    6461  }
    -
    6462  if (req_comp == 2) output[1] = 1;
    -
    6463  if (req_comp == 4) output[3] = 1;
    -
    6464  } else {
    -
    6465  switch (req_comp) {
    -
    6466  case 4: output[3] = 1; /* fallthrough */
    -
    6467  case 3: output[0] = output[1] = output[2] = 0;
    -
    6468  break;
    -
    6469  case 2: output[1] = 1; /* fallthrough */
    -
    6470  case 1: output[0] = 0;
    -
    6471  break;
    -
    6472  }
    -
    6473  }
    -
    6474 }
    -
    6475 
    -
    6476 static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    6477 {
    -
    6478  char buffer[STBI__HDR_BUFLEN];
    -
    6479  char *token;
    -
    6480  int valid = 0;
    -
    6481  int width, height;
    -
    6482  stbi_uc *scanline;
    -
    6483  float *hdr_data;
    -
    6484  int len;
    -
    6485  unsigned char count, value;
    -
    6486  int i, j, k, c1,c2, z;
    -
    6487  const char *headerToken;
    -
    6488  STBI_NOTUSED(ri);
    -
    6489 
    -
    6490  // Check identifier
    -
    6491  headerToken = stbi__hdr_gettoken(s,buffer);
    -
    6492  if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0)
    -
    6493  return stbi__errpf("not HDR", "Corrupt HDR image");
    -
    6494 
    -
    6495  // Parse header
    -
    6496  for(;;) {
    -
    6497  token = stbi__hdr_gettoken(s,buffer);
    -
    6498  if (token[0] == 0) break;
    -
    6499  if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
    -
    6500  }
    -
    6501 
    -
    6502  if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format");
    +
    6451  int count, nleft, len;
    +
    6452 
    +
    6453  count = 0;
    +
    6454  while ((nleft = pixelCount - count) > 0) {
    +
    6455  len = stbi__get8(s);
    +
    6456  if (len == 128) {
    +
    6457  // No-op.
    +
    6458  } else if (len < 128) {
    +
    6459  // Copy next len+1 bytes literally.
    +
    6460  len++;
    +
    6461  if (len > nleft)
    +
    6462  return 0; // corrupt data
    +
    6463  count += len;
    +
    6464  while (len) {
    +
    6465  *p = stbi__get8(s);
    +
    6466  p += 4;
    +
    6467  len--;
    +
    6468  }
    +
    6469  } else if (len > 128) {
    +
    6470  stbi_uc val;
    +
    6471  // Next -len+1 bytes in the dest are replicated from next source
    +
    6472  // byte. (Interpret len as a negative 8-bit int.)
    +
    6473  len = 257 - len;
    +
    6474  if (len > nleft)
    +
    6475  return 0; // corrupt data
    +
    6476  val = stbi__get8(s);
    +
    6477  count += len;
    +
    6478  while (len) {
    +
    6479  *p = val;
    +
    6480  p += 4;
    +
    6481  len--;
    +
    6482  }
    +
    6483  }
    +
    6484  }
    +
    6485 
    +
    6486  return 1;
    +
    6487 }
    +
    6488 
    +
    6489 static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp,
    +
    6490  int req_comp, stbi__result_info *ri, int bpc)
    +
    6491 {
    +
    6492  int pixelCount;
    +
    6493  int channelCount, compression;
    +
    6494  int channel, i;
    +
    6495  int bitdepth;
    +
    6496  int w, h;
    +
    6497  stbi_uc *out;
    +
    6498  STBI_NOTUSED(ri);
    +
    6499 
    +
    6500  // Check identifier
    +
    6501  if (stbi__get32be(s) != 0x38425053) // "8BPS"
    +
    6502  return stbi__errpuc("not PSD", "Corrupt PSD image");
    6503 
    -
    6504  // Parse width and height
    -
    6505  // can't use sscanf() if we're not using stdio!
    -
    6506  token = stbi__hdr_gettoken(s,buffer);
    -
    6507  if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
    -
    6508  token += 3;
    -
    6509  height = (int) strtol(token, &token, 10);
    -
    6510  while (*token == ' ') ++token;
    -
    6511  if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
    -
    6512  token += 3;
    -
    6513  width = (int) strtol(token, NULL, 10);
    -
    6514 
    -
    6515  *x = width;
    -
    6516  *y = height;
    +
    6504  // Check file type version.
    +
    6505  if (stbi__get16be(s) != 1)
    +
    6506  return stbi__errpuc("wrong version",
    +
    6507  "Unsupported version of PSD image");
    +
    6508 
    +
    6509  // Skip 6 reserved bytes.
    +
    6510  stbi__skip(s, 6);
    +
    6511 
    +
    6512  // Read the number of channels (R, G, B, A, etc).
    +
    6513  channelCount = stbi__get16be(s);
    +
    6514  if (channelCount < 0 || channelCount > 16)
    +
    6515  return stbi__errpuc("wrong channel count",
    +
    6516  "Unsupported number of channels in PSD image");
    6517 
    -
    6518  if (comp) *comp = 3;
    -
    6519  if (req_comp == 0) req_comp = 3;
    -
    6520 
    -
    6521  if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0))
    -
    6522  return stbi__errpf("too large", "HDR image is too large");
    -
    6523 
    -
    6524  // Read data
    -
    6525  hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0);
    -
    6526  if (!hdr_data)
    -
    6527  return stbi__errpf("outofmem", "Out of memory");
    -
    6528 
    -
    6529  // Load image data
    -
    6530  // image data is stored as some number of sca
    -
    6531  if ( width < 8 || width >= 32768) {
    -
    6532  // Read flat data
    -
    6533  for (j=0; j < height; ++j) {
    -
    6534  for (i=0; i < width; ++i) {
    -
    6535  stbi_uc rgbe[4];
    -
    6536  main_decode_loop:
    -
    6537  stbi__getn(s, rgbe, 4);
    -
    6538  stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
    -
    6539  }
    -
    6540  }
    -
    6541  } else {
    -
    6542  // Read RLE-encoded data
    -
    6543  scanline = NULL;
    -
    6544 
    -
    6545  for (j = 0; j < height; ++j) {
    -
    6546  c1 = stbi__get8(s);
    -
    6547  c2 = stbi__get8(s);
    -
    6548  len = stbi__get8(s);
    -
    6549  if (c1 != 2 || c2 != 2 || (len & 0x80)) {
    -
    6550  // not run-length encoded, so we have to actually use THIS data as a decoded
    -
    6551  // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
    -
    6552  stbi_uc rgbe[4];
    -
    6553  rgbe[0] = (stbi_uc) c1;
    -
    6554  rgbe[1] = (stbi_uc) c2;
    -
    6555  rgbe[2] = (stbi_uc) len;
    -
    6556  rgbe[3] = (stbi_uc) stbi__get8(s);
    -
    6557  stbi__hdr_convert(hdr_data, rgbe, req_comp);
    -
    6558  i = 1;
    -
    6559  j = 0;
    -
    6560  STBI_FREE(scanline);
    -
    6561  goto main_decode_loop; // yes, this makes no sense
    -
    6562  }
    -
    6563  len <<= 8;
    -
    6564  len |= stbi__get8(s);
    -
    6565  if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
    -
    6566  if (scanline == NULL) {
    -
    6567  scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0);
    -
    6568  if (!scanline) {
    -
    6569  STBI_FREE(hdr_data);
    -
    6570  return stbi__errpf("outofmem", "Out of memory");
    -
    6571  }
    -
    6572  }
    -
    6573 
    -
    6574  for (k = 0; k < 4; ++k) {
    -
    6575  int nleft;
    -
    6576  i = 0;
    -
    6577  while ((nleft = width - i) > 0) {
    -
    6578  count = stbi__get8(s);
    -
    6579  if (count > 128) {
    -
    6580  // Run
    -
    6581  value = stbi__get8(s);
    -
    6582  count -= 128;
    -
    6583  if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
    -
    6584  for (z = 0; z < count; ++z)
    -
    6585  scanline[i++ * 4 + k] = value;
    -
    6586  } else {
    -
    6587  // Dump
    -
    6588  if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
    -
    6589  for (z = 0; z < count; ++z)
    -
    6590  scanline[i++ * 4 + k] = stbi__get8(s);
    -
    6591  }
    -
    6592  }
    -
    6593  }
    -
    6594  for (i=0; i < width; ++i)
    -
    6595  stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
    -
    6596  }
    -
    6597  if (scanline)
    -
    6598  STBI_FREE(scanline);
    -
    6599  }
    -
    6600 
    -
    6601  return hdr_data;
    -
    6602 }
    -
    6603 
    -
    6604 static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6605 {
    -
    6606  char buffer[STBI__HDR_BUFLEN];
    -
    6607  char *token;
    -
    6608  int valid = 0;
    -
    6609  int dummy;
    -
    6610 
    -
    6611  if (!x) x = &dummy;
    -
    6612  if (!y) y = &dummy;
    -
    6613  if (!comp) comp = &dummy;
    -
    6614 
    -
    6615  if (stbi__hdr_test(s) == 0) {
    -
    6616  stbi__rewind( s );
    -
    6617  return 0;
    -
    6618  }
    -
    6619 
    -
    6620  for(;;) {
    -
    6621  token = stbi__hdr_gettoken(s,buffer);
    -
    6622  if (token[0] == 0) break;
    -
    6623  if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
    -
    6624  }
    -
    6625 
    -
    6626  if (!valid) {
    -
    6627  stbi__rewind( s );
    -
    6628  return 0;
    -
    6629  }
    -
    6630  token = stbi__hdr_gettoken(s,buffer);
    -
    6631  if (strncmp(token, "-Y ", 3)) {
    -
    6632  stbi__rewind( s );
    -
    6633  return 0;
    -
    6634  }
    -
    6635  token += 3;
    -
    6636  *y = (int) strtol(token, &token, 10);
    -
    6637  while (*token == ' ') ++token;
    -
    6638  if (strncmp(token, "+X ", 3)) {
    -
    6639  stbi__rewind( s );
    -
    6640  return 0;
    -
    6641  }
    -
    6642  token += 3;
    -
    6643  *x = (int) strtol(token, NULL, 10);
    -
    6644  *comp = 3;
    -
    6645  return 1;
    -
    6646 }
    -
    6647 #endif // STBI_NO_HDR
    -
    6648 
    -
    6649 #ifndef STBI_NO_BMP
    -
    6650 static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6651 {
    -
    6652  void *p;
    -
    6653  stbi__bmp_data info;
    -
    6654 
    -
    6655  info.all_a = 255;
    -
    6656  p = stbi__bmp_parse_header(s, &info);
    -
    6657  stbi__rewind( s );
    -
    6658  if (p == NULL)
    -
    6659  return 0;
    -
    6660  if (x) *x = s->img_x;
    -
    6661  if (y) *y = s->img_y;
    -
    6662  if (comp) *comp = info.ma ? 4 : 3;
    -
    6663  return 1;
    -
    6664 }
    -
    6665 #endif
    -
    6666 
    -
    6667 #ifndef STBI_NO_PSD
    -
    6668 static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6669 {
    -
    6670  int channelCount, dummy;
    -
    6671  if (!x) x = &dummy;
    -
    6672  if (!y) y = &dummy;
    -
    6673  if (!comp) comp = &dummy;
    -
    6674  if (stbi__get32be(s) != 0x38425053) {
    -
    6675  stbi__rewind( s );
    -
    6676  return 0;
    -
    6677  }
    -
    6678  if (stbi__get16be(s) != 1) {
    -
    6679  stbi__rewind( s );
    -
    6680  return 0;
    -
    6681  }
    -
    6682  stbi__skip(s, 6);
    -
    6683  channelCount = stbi__get16be(s);
    -
    6684  if (channelCount < 0 || channelCount > 16) {
    -
    6685  stbi__rewind( s );
    -
    6686  return 0;
    -
    6687  }
    -
    6688  *y = stbi__get32be(s);
    -
    6689  *x = stbi__get32be(s);
    -
    6690  if (stbi__get16be(s) != 8) {
    -
    6691  stbi__rewind( s );
    -
    6692  return 0;
    -
    6693  }
    -
    6694  if (stbi__get16be(s) != 3) {
    -
    6695  stbi__rewind( s );
    -
    6696  return 0;
    -
    6697  }
    -
    6698  *comp = 4;
    -
    6699  return 1;
    -
    6700 }
    -
    6701 #endif
    -
    6702 
    -
    6703 #ifndef STBI_NO_PIC
    -
    6704 static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6705 {
    -
    6706  int act_comp=0,num_packets=0,chained,dummy;
    -
    6707  stbi__pic_packet packets[10];
    -
    6708 
    -
    6709  if (!x) x = &dummy;
    -
    6710  if (!y) y = &dummy;
    -
    6711  if (!comp) comp = &dummy;
    -
    6712 
    -
    6713  if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) {
    -
    6714  stbi__rewind(s);
    -
    6715  return 0;
    -
    6716  }
    +
    6518  // Read the rows and columns of the image.
    +
    6519  h = stbi__get32be(s);
    +
    6520  w = stbi__get32be(s);
    +
    6521 
    +
    6522  // Make sure the depth is 8 bits.
    +
    6523  bitdepth = stbi__get16be(s);
    +
    6524  if (bitdepth != 8 && bitdepth != 16)
    +
    6525  return stbi__errpuc("unsupported bit depth",
    +
    6526  "PSD bit depth is not 8 or 16 bit");
    +
    6527 
    +
    6528  // Make sure the color mode is RGB.
    +
    6529  // Valid options are:
    +
    6530  // 0: Bitmap
    +
    6531  // 1: Grayscale
    +
    6532  // 2: Indexed color
    +
    6533  // 3: RGB color
    +
    6534  // 4: CMYK color
    +
    6535  // 7: Multichannel
    +
    6536  // 8: Duotone
    +
    6537  // 9: Lab color
    +
    6538  if (stbi__get16be(s) != 3)
    +
    6539  return stbi__errpuc("wrong color format",
    +
    6540  "PSD is not in RGB color format");
    +
    6541 
    +
    6542  // Skip the Mode Data. (It's the palette for indexed color; other info for
    +
    6543  // other modes.)
    +
    6544  stbi__skip(s, stbi__get32be(s));
    +
    6545 
    +
    6546  // Skip the image resources. (resolution, pen tool paths, etc)
    +
    6547  stbi__skip(s, stbi__get32be(s));
    +
    6548 
    +
    6549  // Skip the reserved data.
    +
    6550  stbi__skip(s, stbi__get32be(s));
    +
    6551 
    +
    6552  // Find out if the data is compressed.
    +
    6553  // Known values:
    +
    6554  // 0: no compression
    +
    6555  // 1: RLE compressed
    +
    6556  compression = stbi__get16be(s);
    +
    6557  if (compression > 1)
    +
    6558  return stbi__errpuc("bad compression",
    +
    6559  "PSD has an unknown compression format");
    +
    6560 
    +
    6561  // Check size
    +
    6562  if (!stbi__mad3sizes_valid(4, w, h, 0))
    +
    6563  return stbi__errpuc("too large", "Corrupt PSD");
    +
    6564 
    +
    6565  // Create the destination image.
    +
    6566 
    +
    6567  if (!compression && bitdepth == 16 && bpc == 16) {
    +
    6568  out = (stbi_uc *)stbi__malloc_mad3(8, w, h, 0);
    +
    6569  ri->bits_per_channel = 16;
    +
    6570  } else
    +
    6571  out = (stbi_uc *)stbi__malloc(4 * w * h);
    +
    6572 
    +
    6573  if (!out)
    +
    6574  return stbi__errpuc("outofmem", "Out of memory");
    +
    6575  pixelCount = w * h;
    +
    6576 
    +
    6577  // Initialize the data to zero.
    +
    6578  // memset( out, 0, pixelCount * 4 );
    +
    6579 
    +
    6580  // Finally, the image data.
    +
    6581  if (compression) {
    +
    6582  // RLE as used by .PSD and .TIFF
    +
    6583  // Loop until you get the number of unpacked bytes you are expecting:
    +
    6584  // Read the next source byte into n.
    +
    6585  // If n is between 0 and 127 inclusive, copy the next n+1 bytes
    +
    6586  // literally. Else if n is between -127 and -1 inclusive, copy the
    +
    6587  // next byte -n+1 times. Else if n is 128, noop.
    +
    6588  // Endloop
    +
    6589 
    +
    6590  // The RLE-compressed data is preceeded by a 2-byte data count for each
    +
    6591  // row in the data, which we're going to just skip.
    +
    6592  stbi__skip(s, h * channelCount * 2);
    +
    6593 
    +
    6594  // Read the RLE data by channel.
    +
    6595  for (channel = 0; channel < 4; channel++) {
    +
    6596  stbi_uc *p;
    +
    6597 
    +
    6598  p = out + channel;
    +
    6599  if (channel >= channelCount) {
    +
    6600  // Fill this channel with default data.
    +
    6601  for (i = 0; i < pixelCount; i++, p += 4)
    +
    6602  *p = (channel == 3 ? 255 : 0);
    +
    6603  } else {
    +
    6604  // Read the RLE data.
    +
    6605  if (!stbi__psd_decode_rle(s, p, pixelCount)) {
    +
    6606  STBI_FREE(out);
    +
    6607  return stbi__errpuc("corrupt", "bad RLE data");
    +
    6608  }
    +
    6609  }
    +
    6610  }
    +
    6611 
    +
    6612  } else {
    +
    6613  // We're at the raw image data. It's each channel in order (Red, Green,
    +
    6614  // Blue, Alpha, ...) where each channel consists of an 8-bit (or 16-bit)
    +
    6615  // value for each pixel in the image.
    +
    6616 
    +
    6617  // Read the data by channel.
    +
    6618  for (channel = 0; channel < 4; channel++) {
    +
    6619  if (channel >= channelCount) {
    +
    6620  // Fill this channel with default data.
    +
    6621  if (bitdepth == 16 && bpc == 16) {
    +
    6622  stbi__uint16 *q = ((stbi__uint16 *)out) + channel;
    +
    6623  stbi__uint16 val = channel == 3 ? 65535 : 0;
    +
    6624  for (i = 0; i < pixelCount; i++, q += 4)
    +
    6625  *q = val;
    +
    6626  } else {
    +
    6627  stbi_uc *p = out + channel;
    +
    6628  stbi_uc val = channel == 3 ? 255 : 0;
    +
    6629  for (i = 0; i < pixelCount; i++, p += 4)
    +
    6630  *p = val;
    +
    6631  }
    +
    6632  } else {
    +
    6633  if (ri->bits_per_channel == 16) { // output bpc
    +
    6634  stbi__uint16 *q = ((stbi__uint16 *)out) + channel;
    +
    6635  for (i = 0; i < pixelCount; i++, q += 4)
    +
    6636  *q = (stbi__uint16)stbi__get16be(s);
    +
    6637  } else {
    +
    6638  stbi_uc *p = out + channel;
    +
    6639  if (bitdepth == 16) { // input bpc
    +
    6640  for (i = 0; i < pixelCount; i++, p += 4)
    +
    6641  *p = (stbi_uc)(stbi__get16be(s) >> 8);
    +
    6642  } else {
    +
    6643  for (i = 0; i < pixelCount; i++, p += 4)
    +
    6644  *p = stbi__get8(s);
    +
    6645  }
    +
    6646  }
    +
    6647  }
    +
    6648  }
    +
    6649  }
    +
    6650 
    +
    6651  // remove weird white matte from PSD
    +
    6652  if (channelCount >= 4) {
    +
    6653  if (ri->bits_per_channel == 16) {
    +
    6654  for (i = 0; i < w * h; ++i) {
    +
    6655  stbi__uint16 *pixel = (stbi__uint16 *)out + 4 * i;
    +
    6656  if (pixel[3] != 0 && pixel[3] != 65535) {
    +
    6657  float a = pixel[3] / 65535.0f;
    +
    6658  float ra = 1.0f / a;
    +
    6659  float inv_a = 65535.0f * (1 - ra);
    +
    6660  pixel[0] = (stbi__uint16)(pixel[0] * ra + inv_a);
    +
    6661  pixel[1] = (stbi__uint16)(pixel[1] * ra + inv_a);
    +
    6662  pixel[2] = (stbi__uint16)(pixel[2] * ra + inv_a);
    +
    6663  }
    +
    6664  }
    +
    6665  } else {
    +
    6666  for (i = 0; i < w * h; ++i) {
    +
    6667  unsigned char *pixel = out + 4 * i;
    +
    6668  if (pixel[3] != 0 && pixel[3] != 255) {
    +
    6669  float a = pixel[3] / 255.0f;
    +
    6670  float ra = 1.0f / a;
    +
    6671  float inv_a = 255.0f * (1 - ra);
    +
    6672  pixel[0] = (unsigned char)(pixel[0] * ra + inv_a);
    +
    6673  pixel[1] = (unsigned char)(pixel[1] * ra + inv_a);
    +
    6674  pixel[2] = (unsigned char)(pixel[2] * ra + inv_a);
    +
    6675  }
    +
    6676  }
    +
    6677  }
    +
    6678  }
    +
    6679 
    +
    6680  // convert to desired output format
    +
    6681  if (req_comp && req_comp != 4) {
    +
    6682  if (ri->bits_per_channel == 16)
    +
    6683  out = (stbi_uc *)stbi__convert_format16((stbi__uint16 *)out, 4,
    +
    6684  req_comp, w, h);
    +
    6685  else
    +
    6686  out = stbi__convert_format(out, 4, req_comp, w, h);
    +
    6687  if (out == NULL)
    +
    6688  return out; // stbi__convert_format frees input on failure
    +
    6689  }
    +
    6690 
    +
    6691  if (comp)
    +
    6692  *comp = 4;
    +
    6693  *y = h;
    +
    6694  *x = w;
    +
    6695 
    +
    6696  return out;
    +
    6697 }
    +
    6698 #endif
    +
    6699 
    +
    6700  // *************************************************************************************************
    +
    6701  // Softimage PIC loader
    +
    6702  // by Tom Seddon
    +
    6703  //
    +
    6704  // See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
    +
    6705  // See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
    +
    6706 
    +
    6707 #ifndef STBI_NO_PIC
    +
    6708 static int stbi__pic_is4(stbi__context *s, const char *str)
    +
    6709 {
    +
    6710  int i;
    +
    6711  for (i = 0; i < 4; ++i)
    +
    6712  if (stbi__get8(s) != (stbi_uc)str[i])
    +
    6713  return 0;
    +
    6714 
    +
    6715  return 1;
    +
    6716 }
    6717 
    -
    6718  stbi__skip(s, 88);
    -
    6719 
    -
    6720  *x = stbi__get16be(s);
    -
    6721  *y = stbi__get16be(s);
    -
    6722  if (stbi__at_eof(s)) {
    -
    6723  stbi__rewind( s);
    -
    6724  return 0;
    -
    6725  }
    -
    6726  if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
    -
    6727  stbi__rewind( s );
    -
    6728  return 0;
    -
    6729  }
    +
    6718 static int stbi__pic_test_core(stbi__context *s)
    +
    6719 {
    +
    6720  int i;
    +
    6721 
    +
    6722  if (!stbi__pic_is4(s, "\x53\x80\xF6\x34"))
    +
    6723  return 0;
    +
    6724 
    +
    6725  for (i = 0; i < 84; ++i)
    +
    6726  stbi__get8(s);
    +
    6727 
    +
    6728  if (!stbi__pic_is4(s, "PICT"))
    +
    6729  return 0;
    6730 
    -
    6731  stbi__skip(s, 8);
    -
    6732 
    -
    6733  do {
    -
    6734  stbi__pic_packet *packet;
    -
    6735 
    -
    6736  if (num_packets==sizeof(packets)/sizeof(packets[0]))
    -
    6737  return 0;
    -
    6738 
    -
    6739  packet = &packets[num_packets++];
    -
    6740  chained = stbi__get8(s);
    -
    6741  packet->size = stbi__get8(s);
    -
    6742  packet->type = stbi__get8(s);
    -
    6743  packet->channel = stbi__get8(s);
    -
    6744  act_comp |= packet->channel;
    -
    6745 
    -
    6746  if (stbi__at_eof(s)) {
    -
    6747  stbi__rewind( s );
    -
    6748  return 0;
    -
    6749  }
    -
    6750  if (packet->size != 8) {
    -
    6751  stbi__rewind( s );
    -
    6752  return 0;
    -
    6753  }
    -
    6754  } while (chained);
    -
    6755 
    -
    6756  *comp = (act_comp & 0x10 ? 4 : 3);
    -
    6757 
    -
    6758  return 1;
    -
    6759 }
    -
    6760 #endif
    -
    6761 
    -
    6762 // *************************************************************************************************
    -
    6763 // Portable Gray Map and Portable Pixel Map loader
    -
    6764 // by Ken Miller
    -
    6765 //
    -
    6766 // PGM: http://netpbm.sourceforge.net/doc/pgm.html
    -
    6767 // PPM: http://netpbm.sourceforge.net/doc/ppm.html
    -
    6768 //
    -
    6769 // Known limitations:
    -
    6770 // Does not support comments in the header section
    -
    6771 // Does not support ASCII image data (formats P2 and P3)
    -
    6772 // Does not support 16-bit-per-channel
    -
    6773 
    -
    6774 #ifndef STBI_NO_PNM
    -
    6775 
    -
    6776 static int stbi__pnm_test(stbi__context *s)
    -
    6777 {
    -
    6778  char p, t;
    -
    6779  p = (char) stbi__get8(s);
    -
    6780  t = (char) stbi__get8(s);
    -
    6781  if (p != 'P' || (t != '5' && t != '6')) {
    -
    6782  stbi__rewind( s );
    -
    6783  return 0;
    -
    6784  }
    -
    6785  return 1;
    -
    6786 }
    -
    6787 
    -
    6788 static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
    -
    6789 {
    -
    6790  stbi_uc *out;
    -
    6791  STBI_NOTUSED(ri);
    +
    6731  return 1;
    +
    6732 }
    +
    6733 
    +
    6734 typedef struct {
    +
    6735  stbi_uc size, type, channel;
    +
    6736 } stbi__pic_packet;
    +
    6737 
    +
    6738 static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
    +
    6739 {
    +
    6740  int mask = 0x80, i;
    +
    6741 
    +
    6742  for (i = 0; i < 4; ++i, mask >>= 1) {
    +
    6743  if (channel & mask) {
    +
    6744  if (stbi__at_eof(s))
    +
    6745  return stbi__errpuc("bad file", "PIC file too short");
    +
    6746  dest[i] = stbi__get8(s);
    +
    6747  }
    +
    6748  }
    +
    6749 
    +
    6750  return dest;
    +
    6751 }
    +
    6752 
    +
    6753 static void stbi__copyval(int channel, stbi_uc *dest, const stbi_uc *src)
    +
    6754 {
    +
    6755  int mask = 0x80, i;
    +
    6756 
    +
    6757  for (i = 0; i < 4; ++i, mask >>= 1)
    +
    6758  if (channel & mask)
    +
    6759  dest[i] = src[i];
    +
    6760 }
    +
    6761 
    +
    6762 static stbi_uc *stbi__pic_load_core(stbi__context *s, int width, int height,
    +
    6763  int *comp, stbi_uc *result)
    +
    6764 {
    +
    6765  int act_comp = 0, num_packets = 0, y, chained;
    +
    6766  stbi__pic_packet packets[10];
    +
    6767 
    +
    6768  // this will (should...) cater for even some bizarre stuff like having data
    +
    6769  // for the same channel in multiple packets.
    +
    6770  do {
    +
    6771  stbi__pic_packet *packet;
    +
    6772 
    +
    6773  if (num_packets == sizeof(packets) / sizeof(packets[0]))
    +
    6774  return stbi__errpuc("bad format", "too many packets");
    +
    6775 
    +
    6776  packet = &packets[num_packets++];
    +
    6777 
    +
    6778  chained = stbi__get8(s);
    +
    6779  packet->size = stbi__get8(s);
    +
    6780  packet->type = stbi__get8(s);
    +
    6781  packet->channel = stbi__get8(s);
    +
    6782 
    +
    6783  act_comp |= packet->channel;
    +
    6784 
    +
    6785  if (stbi__at_eof(s))
    +
    6786  return stbi__errpuc("bad file", "file too short (reading packets)");
    +
    6787  if (packet->size != 8)
    +
    6788  return stbi__errpuc("bad format", "packet isn't 8bpp");
    +
    6789  } while (chained);
    +
    6790 
    +
    6791  *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
    6792 
    -
    6793  if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))
    -
    6794  return 0;
    +
    6793  for (y = 0; y < height; ++y) {
    +
    6794  int packet_idx;
    6795 
    -
    6796  *x = s->img_x;
    -
    6797  *y = s->img_y;
    -
    6798  if (comp) *comp = s->img_n;
    +
    6796  for (packet_idx = 0; packet_idx < num_packets; ++packet_idx) {
    +
    6797  stbi__pic_packet *packet = &packets[packet_idx];
    +
    6798  stbi_uc *dest = result + y * width * 4;
    6799 
    -
    6800  if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0))
    -
    6801  return stbi__errpuc("too large", "PNM too large");
    -
    6802 
    -
    6803  out = (stbi_uc *) stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0);
    -
    6804  if (!out) return stbi__errpuc("outofmem", "Out of memory");
    -
    6805  stbi__getn(s, out, s->img_n * s->img_x * s->img_y);
    -
    6806 
    -
    6807  if (req_comp && req_comp != s->img_n) {
    -
    6808  out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
    -
    6809  if (out == NULL) return out; // stbi__convert_format frees input on failure
    -
    6810  }
    -
    6811  return out;
    -
    6812 }
    +
    6800  switch (packet->type) {
    +
    6801  default:
    +
    6802  return stbi__errpuc("bad format",
    +
    6803  "packet has bad compression type");
    +
    6804 
    +
    6805  case 0: { // uncompressed
    +
    6806  int x;
    +
    6807 
    +
    6808  for (x = 0; x < width; ++x, dest += 4)
    +
    6809  if (!stbi__readval(s, packet->channel, dest))
    +
    6810  return 0;
    +
    6811  break;
    +
    6812  }
    6813 
    -
    6814 static int stbi__pnm_isspace(char c)
    -
    6815 {
    -
    6816  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
    -
    6817 }
    -
    6818 
    -
    6819 static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
    -
    6820 {
    -
    6821  for (;;) {
    -
    6822  while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
    -
    6823  *c = (char) stbi__get8(s);
    -
    6824 
    -
    6825  if (stbi__at_eof(s) || *c != '#')
    -
    6826  break;
    -
    6827 
    -
    6828  while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' )
    -
    6829  *c = (char) stbi__get8(s);
    -
    6830  }
    -
    6831 }
    -
    6832 
    -
    6833 static int stbi__pnm_isdigit(char c)
    -
    6834 {
    -
    6835  return c >= '0' && c <= '9';
    -
    6836 }
    +
    6814  case 1: // Pure RLE
    +
    6815  {
    +
    6816  int left = width, i;
    +
    6817 
    +
    6818  while (left > 0) {
    +
    6819  stbi_uc count, value[4];
    +
    6820 
    +
    6821  count = stbi__get8(s);
    +
    6822  if (stbi__at_eof(s))
    +
    6823  return stbi__errpuc("bad file",
    +
    6824  "file too short (pure read count)");
    +
    6825 
    +
    6826  if (count > left)
    +
    6827  count = (stbi_uc)left;
    +
    6828 
    +
    6829  if (!stbi__readval(s, packet->channel, value))
    +
    6830  return 0;
    +
    6831 
    +
    6832  for (i = 0; i < count; ++i, dest += 4)
    +
    6833  stbi__copyval(packet->channel, dest, value);
    +
    6834  left -= count;
    +
    6835  }
    +
    6836  } break;
    6837 
    -
    6838 static int stbi__pnm_getinteger(stbi__context *s, char *c)
    -
    6839 {
    -
    6840  int value = 0;
    -
    6841 
    -
    6842  while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
    -
    6843  value = value*10 + (*c - '0');
    -
    6844  *c = (char) stbi__get8(s);
    -
    6845  }
    -
    6846 
    -
    6847  return value;
    -
    6848 }
    -
    6849 
    -
    6850 static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
    -
    6851 {
    -
    6852  int maxv, dummy;
    -
    6853  char c, p, t;
    -
    6854 
    -
    6855  if (!x) x = &dummy;
    -
    6856  if (!y) y = &dummy;
    -
    6857  if (!comp) comp = &dummy;
    +
    6838  case 2: { // Mixed RLE
    +
    6839  int left = width;
    +
    6840  while (left > 0) {
    +
    6841  int count = stbi__get8(s), i;
    +
    6842  if (stbi__at_eof(s))
    +
    6843  return stbi__errpuc(
    +
    6844  "bad file", "file too short (mixed read count)");
    +
    6845 
    +
    6846  if (count >= 128) { // Repeated
    +
    6847  stbi_uc value[4];
    +
    6848 
    +
    6849  if (count == 128)
    +
    6850  count = stbi__get16be(s);
    +
    6851  else
    +
    6852  count -= 127;
    +
    6853  if (count > left)
    +
    6854  return stbi__errpuc("bad file", "scanline overrun");
    +
    6855 
    +
    6856  if (!stbi__readval(s, packet->channel, value))
    +
    6857  return 0;
    6858 
    -
    6859  stbi__rewind(s);
    -
    6860 
    -
    6861  // Get identifier
    -
    6862  p = (char) stbi__get8(s);
    -
    6863  t = (char) stbi__get8(s);
    -
    6864  if (p != 'P' || (t != '5' && t != '6')) {
    -
    6865  stbi__rewind(s);
    -
    6866  return 0;
    -
    6867  }
    -
    6868 
    -
    6869  *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm
    -
    6870 
    -
    6871  c = (char) stbi__get8(s);
    -
    6872  stbi__pnm_skip_whitespace(s, &c);
    -
    6873 
    -
    6874  *x = stbi__pnm_getinteger(s, &c); // read width
    -
    6875  stbi__pnm_skip_whitespace(s, &c);
    -
    6876 
    -
    6877  *y = stbi__pnm_getinteger(s, &c); // read height
    -
    6878  stbi__pnm_skip_whitespace(s, &c);
    -
    6879 
    -
    6880  maxv = stbi__pnm_getinteger(s, &c); // read max value
    -
    6881 
    -
    6882  if (maxv > 255)
    -
    6883  return stbi__err("max value > 255", "PPM image not 8-bit");
    -
    6884  else
    -
    6885  return 1;
    -
    6886 }
    -
    6887 #endif
    -
    6888 
    -
    6889 static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
    -
    6890 {
    -
    6891  #ifndef STBI_NO_JPEG
    -
    6892  if (stbi__jpeg_info(s, x, y, comp)) return 1;
    -
    6893  #endif
    -
    6894 
    -
    6895  #ifndef STBI_NO_PNG
    -
    6896  if (stbi__png_info(s, x, y, comp)) return 1;
    -
    6897  #endif
    -
    6898 
    -
    6899  #ifndef STBI_NO_GIF
    -
    6900  if (stbi__gif_info(s, x, y, comp)) return 1;
    -
    6901  #endif
    -
    6902 
    -
    6903  #ifndef STBI_NO_BMP
    -
    6904  if (stbi__bmp_info(s, x, y, comp)) return 1;
    -
    6905  #endif
    -
    6906 
    -
    6907  #ifndef STBI_NO_PSD
    -
    6908  if (stbi__psd_info(s, x, y, comp)) return 1;
    -
    6909  #endif
    -
    6910 
    -
    6911  #ifndef STBI_NO_PIC
    -
    6912  if (stbi__pic_info(s, x, y, comp)) return 1;
    -
    6913  #endif
    -
    6914 
    -
    6915  #ifndef STBI_NO_PNM
    -
    6916  if (stbi__pnm_info(s, x, y, comp)) return 1;
    -
    6917  #endif
    -
    6918 
    -
    6919  #ifndef STBI_NO_HDR
    -
    6920  if (stbi__hdr_info(s, x, y, comp)) return 1;
    -
    6921  #endif
    -
    6922 
    -
    6923  // test tga last because it's a crappy test!
    -
    6924  #ifndef STBI_NO_TGA
    -
    6925  if (stbi__tga_info(s, x, y, comp))
    -
    6926  return 1;
    -
    6927  #endif
    -
    6928  return stbi__err("unknown image type", "Image not of any known type, or corrupt");
    -
    6929 }
    -
    6930 
    -
    6931 #ifndef STBI_NO_STDIO
    -
    6932 STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
    -
    6933 {
    -
    6934  FILE *f = stbi__fopen(filename, "rb");
    -
    6935  int result;
    -
    6936  if (!f) return stbi__err("can't fopen", "Unable to open file");
    -
    6937  result = stbi_info_from_file(f, x, y, comp);
    -
    6938  fclose(f);
    -
    6939  return result;
    -
    6940 }
    -
    6941 
    -
    6942 STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
    -
    6943 {
    -
    6944  int r;
    -
    6945  stbi__context s;
    -
    6946  long pos = ftell(f);
    -
    6947  stbi__start_file(&s, f);
    -
    6948  r = stbi__info_main(&s,x,y,comp);
    -
    6949  fseek(f,pos,SEEK_SET);
    -
    6950  return r;
    -
    6951 }
    -
    6952 #endif // !STBI_NO_STDIO
    -
    6953 
    -
    6954 STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
    -
    6955 {
    -
    6956  stbi__context s;
    -
    6957  stbi__start_mem(&s,buffer,len);
    -
    6958  return stbi__info_main(&s,x,y,comp);
    -
    6959 }
    -
    6960 
    -
    6961 STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
    -
    6962 {
    -
    6963  stbi__context s;
    -
    6964  stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);
    -
    6965  return stbi__info_main(&s,x,y,comp);
    -
    6966 }
    -
    6967 
    -
    6968 #endif // STB_IMAGE_IMPLEMENTATION
    -
    6969 
    -
    6970 /*
    -
    6971  revision history:
    -
    6972  2.16 (2017-07-23) all functions have 16-bit variants;
    -
    6973  STBI_NO_STDIO works again;
    -
    6974  compilation fixes;
    -
    6975  fix rounding in unpremultiply;
    -
    6976  optimize vertical flip;
    -
    6977  disable raw_len validation;
    -
    6978  documentation fixes
    -
    6979  2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
    -
    6980  warning fixes; disable run-time SSE detection on gcc;
    -
    6981  uniform handling of optional "return" values;
    -
    6982  thread-safe initialization of zlib tables
    -
    6983  2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
    -
    6984  2.13 (2016-11-29) add 16-bit API, only supported for PNG right now
    -
    6985  2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
    -
    6986  2.11 (2016-04-02) allocate large structures on the stack
    -
    6987  remove white matting for transparent PSD
    -
    6988  fix reported channel count for PNG & BMP
    -
    6989  re-enable SSE2 in non-gcc 64-bit
    -
    6990  support RGB-formatted JPEG
    -
    6991  read 16-bit PNGs (only as 8-bit)
    -
    6992  2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED
    -
    6993  2.09 (2016-01-16) allow comments in PNM files
    -
    6994  16-bit-per-pixel TGA (not bit-per-component)
    -
    6995  info() for TGA could break due to .hdr handling
    -
    6996  info() for BMP to shares code instead of sloppy parse
    -
    6997  can use STBI_REALLOC_SIZED if allocator doesn't support realloc
    -
    6998  code cleanup
    -
    6999  2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA
    -
    7000  2.07 (2015-09-13) fix compiler warnings
    -
    7001  partial animated GIF support
    -
    7002  limited 16-bpc PSD support
    -
    7003  #ifdef unused functions
    -
    7004  bug with < 92 byte PIC,PNM,HDR,TGA
    -
    7005  2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
    -
    7006  2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
    -
    7007  2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
    -
    7008  2.03 (2015-04-12) extra corruption checking (mmozeiko)
    -
    7009  stbi_set_flip_vertically_on_load (nguillemot)
    -
    7010  fix NEON support; fix mingw support
    -
    7011  2.02 (2015-01-19) fix incorrect assert, fix warning
    -
    7012  2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
    -
    7013  2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
    -
    7014  2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)
    -
    7015  progressive JPEG (stb)
    -
    7016  PGM/PPM support (Ken Miller)
    -
    7017  STBI_MALLOC,STBI_REALLOC,STBI_FREE
    -
    7018  GIF bugfix -- seemingly never worked
    -
    7019  STBI_NO_*, STBI_ONLY_*
    -
    7020  1.48 (2014-12-14) fix incorrectly-named assert()
    -
    7021  1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
    -
    7022  optimize PNG (ryg)
    -
    7023  fix bug in interlaced PNG with user-specified channel count (stb)
    -
    7024  1.46 (2014-08-26)
    -
    7025  fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG
    -
    7026  1.45 (2014-08-16)
    -
    7027  fix MSVC-ARM internal compiler error by wrapping malloc
    -
    7028  1.44 (2014-08-07)
    -
    7029  various warning fixes from Ronny Chevalier
    -
    7030  1.43 (2014-07-15)
    -
    7031  fix MSVC-only compiler problem in code changed in 1.42
    -
    7032  1.42 (2014-07-09)
    -
    7033  don't define _CRT_SECURE_NO_WARNINGS (affects user code)
    -
    7034  fixes to stbi__cleanup_jpeg path
    -
    7035  added STBI_ASSERT to avoid requiring assert.h
    -
    7036  1.41 (2014-06-25)
    -
    7037  fix search&replace from 1.36 that messed up comments/error messages
    -
    7038  1.40 (2014-06-22)
    -
    7039  fix gcc struct-initialization warning
    -
    7040  1.39 (2014-06-15)
    -
    7041  fix to TGA optimization when req_comp != number of components in TGA;
    -
    7042  fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
    -
    7043  add support for BMP version 5 (more ignored fields)
    -
    7044  1.38 (2014-06-06)
    -
    7045  suppress MSVC warnings on integer casts truncating values
    -
    7046  fix accidental rename of 'skip' field of I/O
    -
    7047  1.37 (2014-06-04)
    -
    7048  remove duplicate typedef
    -
    7049  1.36 (2014-06-03)
    -
    7050  convert to header file single-file library
    -
    7051  if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
    -
    7052  1.35 (2014-05-27)
    -
    7053  various warnings
    -
    7054  fix broken STBI_SIMD path
    -
    7055  fix bug where stbi_load_from_file no longer left file pointer in correct place
    -
    7056  fix broken non-easy path for 32-bit BMP (possibly never used)
    -
    7057  TGA optimization by Arseny Kapoulkine
    -
    7058  1.34 (unknown)
    -
    7059  use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
    -
    7060  1.33 (2011-07-14)
    -
    7061  make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
    -
    7062  1.32 (2011-07-13)
    -
    7063  support for "info" function for all supported filetypes (SpartanJ)
    -
    7064  1.31 (2011-06-20)
    -
    7065  a few more leak fixes, bug in PNG handling (SpartanJ)
    -
    7066  1.30 (2011-06-11)
    -
    7067  added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
    -
    7068  removed deprecated format-specific test/load functions
    -
    7069  removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
    -
    7070  error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
    -
    7071  fix inefficiency in decoding 32-bit BMP (David Woo)
    -
    7072  1.29 (2010-08-16)
    -
    7073  various warning fixes from Aurelien Pocheville
    -
    7074  1.28 (2010-08-01)
    -
    7075  fix bug in GIF palette transparency (SpartanJ)
    -
    7076  1.27 (2010-08-01)
    -
    7077  cast-to-stbi_uc to fix warnings
    -
    7078  1.26 (2010-07-24)
    -
    7079  fix bug in file buffering for PNG reported by SpartanJ
    -
    7080  1.25 (2010-07-17)
    -
    7081  refix trans_data warning (Won Chun)
    -
    7082  1.24 (2010-07-12)
    -
    7083  perf improvements reading from files on platforms with lock-heavy fgetc()
    -
    7084  minor perf improvements for jpeg
    -
    7085  deprecated type-specific functions so we'll get feedback if they're needed
    -
    7086  attempt to fix trans_data warning (Won Chun)
    -
    7087  1.23 fixed bug in iPhone support
    -
    7088  1.22 (2010-07-10)
    -
    7089  removed image *writing* support
    -
    7090  stbi_info support from Jetro Lauha
    -
    7091  GIF support from Jean-Marc Lienher
    -
    7092  iPhone PNG-extensions from James Brown
    -
    7093  warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
    -
    7094  1.21 fix use of 'stbi_uc' in header (reported by jon blow)
    -
    7095  1.20 added support for Softimage PIC, by Tom Seddon
    -
    7096  1.19 bug in interlaced PNG corruption check (found by ryg)
    -
    7097  1.18 (2008-08-02)
    -
    7098  fix a threading bug (local mutable static)
    -
    7099  1.17 support interlaced PNG
    -
    7100  1.16 major bugfix - stbi__convert_format converted one too many pixels
    -
    7101  1.15 initialize some fields for thread safety
    -
    7102  1.14 fix threadsafe conversion bug
    -
    7103  header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
    -
    7104  1.13 threadsafe
    -
    7105  1.12 const qualifiers in the API
    -
    7106  1.11 Support installable IDCT, colorspace conversion routines
    -
    7107  1.10 Fixes for 64-bit (don't use "unsigned long")
    -
    7108  optimized upsampling by Fabian "ryg" Giesen
    -
    7109  1.09 Fix format-conversion for PSD code (bad global variables!)
    -
    7110  1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
    -
    7111  1.07 attempt to fix C++ warning/errors again
    -
    7112  1.06 attempt to fix C++ warning/errors again
    -
    7113  1.05 fix TGA loading to return correct *comp and use good luminance calc
    -
    7114  1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
    -
    7115  1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
    -
    7116  1.02 support for (subset of) HDR files, float interface for preferred access to them
    -
    7117  1.01 fix bug: possible bug in handling right-side up bmps... not sure
    -
    7118  fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
    -
    7119  1.00 interface to zlib that skips zlib header
    -
    7120  0.99 correct handling of alpha in palette
    -
    7121  0.98 TGA loader by lonesock; dynamically add loaders (untested)
    -
    7122  0.97 jpeg errors on too large a file; also catch another malloc failure
    -
    7123  0.96 fix detection of invalid v value - particleman@mollyrocket forum
    -
    7124  0.95 during header scan, seek to markers in case of padding
    -
    7125  0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
    -
    7126  0.93 handle jpegtran output; verbose errors
    -
    7127  0.92 read 4,8,16,24,32-bit BMP files of several formats
    -
    7128  0.91 output 24-bit Windows 3.0 BMP files
    -
    7129  0.90 fix a few more warnings; bump version number to approach 1.0
    -
    7130  0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
    -
    7131  0.60 fix compiling as c++
    -
    7132  0.59 fix warnings: merge Dave Moore's -Wall fixes
    -
    7133  0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
    -
    7134  0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
    -
    7135  0.56 fix bug: zlib uncompressed mode len vs. nlen
    -
    7136  0.55 fix bug: restart_interval not initialized to 0
    -
    7137  0.54 allow NULL for 'int *comp'
    -
    7138  0.53 fix bug in png 3->4; speedup png decoding
    -
    7139  0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
    -
    7140  0.51 obey req_comp requests, 1-component jpegs return as 1-component,
    -
    7141  on 'test' only check type, not whether we support this variant
    -
    7142  0.50 (2006-11-19)
    -
    7143  first released version
    -
    7144 */
    -
    7145 
    +
    6859  for (i = 0; i < count; ++i, dest += 4)
    +
    6860  stbi__copyval(packet->channel, dest, value);
    +
    6861  } else { // Raw
    +
    6862  ++count;
    +
    6863  if (count > left)
    +
    6864  return stbi__errpuc("bad file", "scanline overrun");
    +
    6865 
    +
    6866  for (i = 0; i < count; ++i, dest += 4)
    +
    6867  if (!stbi__readval(s, packet->channel, dest))
    +
    6868  return 0;
    +
    6869  }
    +
    6870  left -= count;
    +
    6871  }
    +
    6872  break;
    +
    6873  }
    +
    6874  }
    +
    6875  }
    +
    6876  }
    +
    6877 
    +
    6878  return result;
    +
    6879 }
    +
    6880 
    +
    6881 static void *stbi__pic_load(stbi__context *s, int *px, int *py, int *comp,
    +
    6882  int req_comp, stbi__result_info *ri)
    +
    6883 {
    +
    6884  stbi_uc *result;
    +
    6885  int i, x, y, internal_comp;
    +
    6886  STBI_NOTUSED(ri);
    +
    6887 
    +
    6888  if (!comp)
    +
    6889  comp = &internal_comp;
    +
    6890 
    +
    6891  for (i = 0; i < 92; ++i)
    +
    6892  stbi__get8(s);
    +
    6893 
    +
    6894  x = stbi__get16be(s);
    +
    6895  y = stbi__get16be(s);
    +
    6896  if (stbi__at_eof(s))
    +
    6897  return stbi__errpuc("bad file", "file too short (pic header)");
    +
    6898  if (!stbi__mad3sizes_valid(x, y, 4, 0))
    +
    6899  return stbi__errpuc("too large", "PIC image too large to decode");
    +
    6900 
    +
    6901  stbi__get32be(s); // skip `ratio'
    +
    6902  stbi__get16be(s); // skip `fields'
    +
    6903  stbi__get16be(s); // skip `pad'
    +
    6904 
    +
    6905  // intermediate buffer is RGBA
    +
    6906  result = (stbi_uc *)stbi__malloc_mad3(x, y, 4, 0);
    +
    6907  memset(result, 0xff, x * y * 4);
    +
    6908 
    +
    6909  if (!stbi__pic_load_core(s, x, y, comp, result)) {
    +
    6910  STBI_FREE(result);
    +
    6911  result = 0;
    +
    6912  }
    +
    6913  *px = x;
    +
    6914  *py = y;
    +
    6915  if (req_comp == 0)
    +
    6916  req_comp = *comp;
    +
    6917  result = stbi__convert_format(result, 4, req_comp, x, y);
    +
    6918 
    +
    6919  return result;
    +
    6920 }
    +
    6921 
    +
    6922 static int stbi__pic_test(stbi__context *s)
    +
    6923 {
    +
    6924  int r = stbi__pic_test_core(s);
    +
    6925  stbi__rewind(s);
    +
    6926  return r;
    +
    6927 }
    +
    6928 #endif
    +
    6929 
    +
    6930  // *************************************************************************************************
    +
    6931  // GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by
    +
    6932  // stb
    +
    6933 
    +
    6934 #ifndef STBI_NO_GIF
    +
    6935 typedef struct {
    +
    6936  stbi__int16 prefix;
    +
    6937  stbi_uc first;
    +
    6938  stbi_uc suffix;
    +
    6939 } stbi__gif_lzw;
    +
    6940 
    +
    6941 typedef struct {
    +
    6942  int w, h;
    +
    6943  stbi_uc *out, *old_out; // output buffer (always 4 components)
    +
    6944  int flags, bgindex, ratio, transparent, eflags, delay;
    +
    6945  stbi_uc pal[256][4];
    +
    6946  stbi_uc lpal[256][4];
    +
    6947  stbi__gif_lzw codes[4096];
    +
    6948  stbi_uc *color_table;
    +
    6949  int parse, step;
    +
    6950  int lflags;
    +
    6951  int start_x, start_y;
    +
    6952  int max_x, max_y;
    +
    6953  int cur_x, cur_y;
    +
    6954  int line_size;
    +
    6955 } stbi__gif;
    +
    6956 
    +
    6957 static int stbi__gif_test_raw(stbi__context *s)
    +
    6958 {
    +
    6959  int sz;
    +
    6960  if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' ||
    +
    6961  stbi__get8(s) != '8')
    +
    6962  return 0;
    +
    6963  sz = stbi__get8(s);
    +
    6964  if (sz != '9' && sz != '7')
    +
    6965  return 0;
    +
    6966  if (stbi__get8(s) != 'a')
    +
    6967  return 0;
    +
    6968  return 1;
    +
    6969 }
    +
    6970 
    +
    6971 static int stbi__gif_test(stbi__context *s)
    +
    6972 {
    +
    6973  int r = stbi__gif_test_raw(s);
    +
    6974  stbi__rewind(s);
    +
    6975  return r;
    +
    6976 }
    +
    6977 
    +
    6978 static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4],
    +
    6979  int num_entries, int transp)
    +
    6980 {
    +
    6981  int i;
    +
    6982  for (i = 0; i < num_entries; ++i) {
    +
    6983  pal[i][2] = stbi__get8(s);
    +
    6984  pal[i][1] = stbi__get8(s);
    +
    6985  pal[i][0] = stbi__get8(s);
    +
    6986  pal[i][3] = transp == i ? 0 : 255;
    +
    6987  }
    +
    6988 }
    +
    6989 
    +
    6990 static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp,
    +
    6991  int is_info)
    +
    6992 {
    +
    6993  stbi_uc version;
    +
    6994  if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' ||
    +
    6995  stbi__get8(s) != '8')
    +
    6996  return stbi__err("not GIF", "Corrupt GIF");
    +
    6997 
    +
    6998  version = stbi__get8(s);
    +
    6999  if (version != '7' && version != '9')
    +
    7000  return stbi__err("not GIF", "Corrupt GIF");
    +
    7001  if (stbi__get8(s) != 'a')
    +
    7002  return stbi__err("not GIF", "Corrupt GIF");
    +
    7003 
    +
    7004  stbi__g_failure_reason = "";
    +
    7005  g->w = stbi__get16le(s);
    +
    7006  g->h = stbi__get16le(s);
    +
    7007  g->flags = stbi__get8(s);
    +
    7008  g->bgindex = stbi__get8(s);
    +
    7009  g->ratio = stbi__get8(s);
    +
    7010  g->transparent = -1;
    +
    7011 
    +
    7012  if (comp != 0)
    +
    7013  *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the
    +
    7014  // comments
    +
    7015 
    +
    7016  if (is_info)
    +
    7017  return 1;
    +
    7018 
    +
    7019  if (g->flags & 0x80)
    +
    7020  stbi__gif_parse_colortable(s, g->pal, 2 << (g->flags & 7), -1);
    +
    7021 
    +
    7022  return 1;
    +
    7023 }
    +
    7024 
    +
    7025 static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
    +
    7026 {
    +
    7027  stbi__gif *g = (stbi__gif *)stbi__malloc(sizeof(stbi__gif));
    +
    7028  if (!stbi__gif_header(s, g, comp, 1)) {
    +
    7029  STBI_FREE(g);
    +
    7030  stbi__rewind(s);
    +
    7031  return 0;
    +
    7032  }
    +
    7033  if (x)
    +
    7034  *x = g->w;
    +
    7035  if (y)
    +
    7036  *y = g->h;
    +
    7037  STBI_FREE(g);
    +
    7038  return 1;
    +
    7039 }
    +
    7040 
    +
    7041 static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
    +
    7042 {
    +
    7043  stbi_uc *p, *c;
    +
    7044 
    +
    7045  // recurse to decode the prefixes, since the linked-list is backwards,
    +
    7046  // and working backwards through an interleaved image would be nasty
    +
    7047  if (g->codes[code].prefix >= 0)
    +
    7048  stbi__out_gif_code(g, g->codes[code].prefix);
    +
    7049 
    +
    7050  if (g->cur_y >= g->max_y)
    +
    7051  return;
    +
    7052 
    +
    7053  p = &g->out[g->cur_x + g->cur_y];
    +
    7054  c = &g->color_table[g->codes[code].suffix * 4];
    +
    7055 
    +
    7056  if (c[3] >= 128) {
    +
    7057  p[0] = c[2];
    +
    7058  p[1] = c[1];
    +
    7059  p[2] = c[0];
    +
    7060  p[3] = c[3];
    +
    7061  }
    +
    7062  g->cur_x += 4;
    +
    7063 
    +
    7064  if (g->cur_x >= g->max_x) {
    +
    7065  g->cur_x = g->start_x;
    +
    7066  g->cur_y += g->step;
    +
    7067 
    +
    7068  while (g->cur_y >= g->max_y && g->parse > 0) {
    +
    7069  g->step = (1 << g->parse) * g->line_size;
    +
    7070  g->cur_y = g->start_y + (g->step >> 1);
    +
    7071  --g->parse;
    +
    7072  }
    +
    7073  }
    +
    7074 }
    +
    7075 
    +
    7076 static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
    +
    7077 {
    +
    7078  stbi_uc lzw_cs;
    +
    7079  stbi__int32 len, init_code;
    +
    7080  stbi__uint32 first;
    +
    7081  stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
    +
    7082  stbi__gif_lzw *p;
    +
    7083 
    +
    7084  lzw_cs = stbi__get8(s);
    +
    7085  if (lzw_cs > 12)
    +
    7086  return NULL;
    +
    7087  clear = 1 << lzw_cs;
    +
    7088  first = 1;
    +
    7089  codesize = lzw_cs + 1;
    +
    7090  codemask = (1 << codesize) - 1;
    +
    7091  bits = 0;
    +
    7092  valid_bits = 0;
    +
    7093  for (init_code = 0; init_code < clear; init_code++) {
    +
    7094  g->codes[init_code].prefix = -1;
    +
    7095  g->codes[init_code].first = (stbi_uc)init_code;
    +
    7096  g->codes[init_code].suffix = (stbi_uc)init_code;
    +
    7097  }
    +
    7098 
    +
    7099  // support no starting clear code
    +
    7100  avail = clear + 2;
    +
    7101  oldcode = -1;
    +
    7102 
    +
    7103  len = 0;
    +
    7104  for (;;) {
    +
    7105  if (valid_bits < codesize) {
    +
    7106  if (len == 0) {
    +
    7107  len = stbi__get8(s); // start new block
    +
    7108  if (len == 0)
    +
    7109  return g->out;
    +
    7110  }
    +
    7111  --len;
    +
    7112  bits |= (stbi__int32)stbi__get8(s) << valid_bits;
    +
    7113  valid_bits += 8;
    +
    7114  } else {
    +
    7115  stbi__int32 code = bits & codemask;
    +
    7116  bits >>= codesize;
    +
    7117  valid_bits -= codesize;
    +
    7118  // @OPTIMIZE: is there some way we can accelerate the non-clear
    +
    7119  // path?
    +
    7120  if (code == clear) { // clear code
    +
    7121  codesize = lzw_cs + 1;
    +
    7122  codemask = (1 << codesize) - 1;
    +
    7123  avail = clear + 2;
    +
    7124  oldcode = -1;
    +
    7125  first = 0;
    +
    7126  } else if (code == clear + 1) { // end of stream code
    +
    7127  stbi__skip(s, len);
    +
    7128  while ((len = stbi__get8(s)) > 0)
    +
    7129  stbi__skip(s, len);
    +
    7130  return g->out;
    +
    7131  } else if (code <= avail) {
    +
    7132  if (first)
    +
    7133  return stbi__errpuc("no clear code", "Corrupt GIF");
    +
    7134 
    +
    7135  if (oldcode >= 0) {
    +
    7136  p = &g->codes[avail++];
    +
    7137  if (avail > 4096)
    +
    7138  return stbi__errpuc("too many codes", "Corrupt GIF");
    +
    7139  p->prefix = (stbi__int16)oldcode;
    +
    7140  p->first = g->codes[oldcode].first;
    +
    7141  p->suffix =
    +
    7142  (code == avail) ? p->first : g->codes[code].first;
    +
    7143  } else if (code == avail)
    +
    7144  return stbi__errpuc("illegal code in raster",
    +
    7145  "Corrupt GIF");
    7146 
    -
    7147 /*
    -
    7148 ------------------------------------------------------------------------------
    -
    7149 This software is available under 2 licenses -- choose whichever you prefer.
    -
    7150 ------------------------------------------------------------------------------
    -
    7151 ALTERNATIVE A - MIT License
    -
    7152 Copyright (c) 2017 Sean Barrett
    -
    7153 Permission is hereby granted, free of charge, to any person obtaining a copy of
    -
    7154 this software and associated documentation files (the "Software"), to deal in
    -
    7155 the Software without restriction, including without limitation the rights to
    -
    7156 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    -
    7157 of the Software, and to permit persons to whom the Software is furnished to do
    -
    7158 so, subject to the following conditions:
    -
    7159 The above copyright notice and this permission notice shall be included in all
    -
    7160 copies or substantial portions of the Software.
    -
    7161 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -
    7162 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -
    7163 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -
    7164 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -
    7165 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -
    7166 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    -
    7167 SOFTWARE.
    -
    7168 ------------------------------------------------------------------------------
    -
    7169 ALTERNATIVE B - Public Domain (www.unlicense.org)
    -
    7170 This is free and unencumbered software released into the public domain.
    -
    7171 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
    -
    7172 software, either in source code form or as a compiled binary, for any purpose,
    -
    7173 commercial or non-commercial, and by any means.
    -
    7174 In jurisdictions that recognize copyright laws, the author or authors of this
    -
    7175 software dedicate any and all copyright interest in the software to the public
    -
    7176 domain. We make this dedication for the benefit of the public at large and to
    -
    7177 the detriment of our heirs and successors. We intend this dedication to be an
    -
    7178 overt act of relinquishment in perpetuity of all present and future rights to
    -
    7179 this software under copyright law.
    -
    7180 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -
    7181 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -
    7182 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -
    7183 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    -
    7184 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    -
    7185 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    -
    7186 ------------------------------------------------------------------------------
    -
    7187 */
    +
    7147  stbi__out_gif_code(g, (stbi__uint16)code);
    +
    7148 
    +
    7149  if ((avail & codemask) == 0 && avail <= 0x0FFF) {
    +
    7150  codesize++;
    +
    7151  codemask = (1 << codesize) - 1;
    +
    7152  }
    +
    7153 
    +
    7154  oldcode = code;
    +
    7155  } else {
    +
    7156  return stbi__errpuc("illegal code in raster", "Corrupt GIF");
    +
    7157  }
    +
    7158  }
    +
    7159  }
    +
    7160 }
    +
    7161 
    +
    7162 static void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1,
    +
    7163  int y1)
    +
    7164 {
    +
    7165  int x, y;
    +
    7166  stbi_uc *c = g->pal[g->bgindex];
    +
    7167  for (y = y0; y < y1; y += 4 * g->w) {
    +
    7168  for (x = x0; x < x1; x += 4) {
    +
    7169  stbi_uc *p = &g->out[y + x];
    +
    7170  p[0] = c[2];
    +
    7171  p[1] = c[1];
    +
    7172  p[2] = c[0];
    +
    7173  p[3] = 0;
    +
    7174  }
    +
    7175  }
    +
    7176 }
    +
    7177 
    +
    7178 // this function is designed to support animated gifs, although stb_image
    +
    7179 // doesn't support it
    +
    7180 static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp,
    +
    7181  int req_comp)
    +
    7182 {
    +
    7183  int i;
    +
    7184  stbi_uc *prev_out = 0;
    +
    7185 
    +
    7186  if (g->out == 0 && !stbi__gif_header(s, g, comp, 0))
    +
    7187  return 0; // stbi__g_failure_reason set by stbi__gif_header
    +
    7188 
    +
    7189  if (!stbi__mad3sizes_valid(g->w, g->h, 4, 0))
    +
    7190  return stbi__errpuc("too large", "GIF too large");
    +
    7191 
    +
    7192  prev_out = g->out;
    +
    7193  g->out = (stbi_uc *)stbi__malloc_mad3(4, g->w, g->h, 0);
    +
    7194  if (g->out == 0)
    +
    7195  return stbi__errpuc("outofmem", "Out of memory");
    +
    7196 
    +
    7197  switch ((g->eflags & 0x1C) >> 2) {
    +
    7198  case 0: // unspecified (also always used on 1st frame)
    +
    7199  stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h);
    +
    7200  break;
    +
    7201  case 1: // do not dispose
    +
    7202  if (prev_out)
    +
    7203  memcpy(g->out, prev_out, 4 * g->w * g->h);
    +
    7204  g->old_out = prev_out;
    +
    7205  break;
    +
    7206  case 2: // dispose to background
    +
    7207  if (prev_out)
    +
    7208  memcpy(g->out, prev_out, 4 * g->w * g->h);
    +
    7209  stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x,
    +
    7210  g->max_y);
    +
    7211  break;
    +
    7212  case 3: // dispose to previous
    +
    7213  if (g->old_out) {
    +
    7214  for (i = g->start_y; i < g->max_y; i += 4 * g->w)
    +
    7215  memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x],
    +
    7216  g->max_x - g->start_x);
    +
    7217  }
    +
    7218  break;
    +
    7219  }
    +
    7220 
    +
    7221  for (;;) {
    +
    7222  switch (stbi__get8(s)) {
    +
    7223  case 0x2C: /* Image Descriptor */
    +
    7224  {
    +
    7225  int prev_trans = -1;
    +
    7226  stbi__int32 x, y, w, h;
    +
    7227  stbi_uc *o;
    +
    7228 
    +
    7229  x = stbi__get16le(s);
    +
    7230  y = stbi__get16le(s);
    +
    7231  w = stbi__get16le(s);
    +
    7232  h = stbi__get16le(s);
    +
    7233  if (((x + w) > (g->w)) || ((y + h) > (g->h)))
    +
    7234  return stbi__errpuc("bad Image Descriptor", "Corrupt GIF");
    +
    7235 
    +
    7236  g->line_size = g->w * 4;
    +
    7237  g->start_x = x * 4;
    +
    7238  g->start_y = y * g->line_size;
    +
    7239  g->max_x = g->start_x + w * 4;
    +
    7240  g->max_y = g->start_y + h * g->line_size;
    +
    7241  g->cur_x = g->start_x;
    +
    7242  g->cur_y = g->start_y;
    +
    7243 
    +
    7244  g->lflags = stbi__get8(s);
    +
    7245 
    +
    7246  if (g->lflags & 0x40) {
    +
    7247  g->step = 8 * g->line_size; // first interlaced spacing
    +
    7248  g->parse = 3;
    +
    7249  } else {
    +
    7250  g->step = g->line_size;
    +
    7251  g->parse = 0;
    +
    7252  }
    +
    7253 
    +
    7254  if (g->lflags & 0x80) {
    +
    7255  stbi__gif_parse_colortable(s, g->lpal, 2 << (g->lflags & 7),
    +
    7256  g->eflags & 0x01 ? g->transparent
    +
    7257  : -1);
    +
    7258  g->color_table = (stbi_uc *)g->lpal;
    +
    7259  } else if (g->flags & 0x80) {
    +
    7260  if (g->transparent >= 0 && (g->eflags & 0x01)) {
    +
    7261  prev_trans = g->pal[g->transparent][3];
    +
    7262  g->pal[g->transparent][3] = 0;
    +
    7263  }
    +
    7264  g->color_table = (stbi_uc *)g->pal;
    +
    7265  } else
    +
    7266  return stbi__errpuc("missing color table", "Corrupt GIF");
    +
    7267 
    +
    7268  o = stbi__process_gif_raster(s, g);
    +
    7269  if (o == NULL)
    +
    7270  return NULL;
    +
    7271 
    +
    7272  if (prev_trans != -1)
    +
    7273  g->pal[g->transparent][3] = (stbi_uc)prev_trans;
    +
    7274 
    +
    7275  return o;
    +
    7276  }
    +
    7277 
    +
    7278  case 0x21: // Comment Extension.
    +
    7279  {
    +
    7280  int len;
    +
    7281  if (stbi__get8(s) == 0xF9) { // Graphic Control Extension.
    +
    7282  len = stbi__get8(s);
    +
    7283  if (len == 4) {
    +
    7284  g->eflags = stbi__get8(s);
    +
    7285  g->delay = stbi__get16le(s);
    +
    7286  g->transparent = stbi__get8(s);
    +
    7287  } else {
    +
    7288  stbi__skip(s, len);
    +
    7289  break;
    +
    7290  }
    +
    7291  }
    +
    7292  while ((len = stbi__get8(s)) != 0)
    +
    7293  stbi__skip(s, len);
    +
    7294  break;
    +
    7295  }
    +
    7296 
    +
    7297  case 0x3B: // gif stream termination code
    +
    7298  return (stbi_uc *)s; // using '1' causes warning on some compilers
    +
    7299 
    +
    7300  default:
    +
    7301  return stbi__errpuc("unknown code", "Corrupt GIF");
    +
    7302  }
    +
    7303  }
    +
    7304 
    +
    7305  STBI_NOTUSED(req_comp);
    +
    7306 }
    +
    7307 
    +
    7308 static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp,
    +
    7309  int req_comp, stbi__result_info *ri)
    +
    7310 {
    +
    7311  stbi_uc *u = 0;
    +
    7312  stbi__gif *g = (stbi__gif *)stbi__malloc(sizeof(stbi__gif));
    +
    7313  memset(g, 0, sizeof(*g));
    +
    7314  STBI_NOTUSED(ri);
    +
    7315 
    +
    7316  u = stbi__gif_load_next(s, g, comp, req_comp);
    +
    7317  if (u == (stbi_uc *)s)
    +
    7318  u = 0; // end of animated gif marker
    +
    7319  if (u) {
    +
    7320  *x = g->w;
    +
    7321  *y = g->h;
    +
    7322  if (req_comp && req_comp != 4)
    +
    7323  u = stbi__convert_format(u, 4, req_comp, g->w, g->h);
    +
    7324  } else if (g->out)
    +
    7325  STBI_FREE(g->out);
    +
    7326  STBI_FREE(g);
    +
    7327  return u;
    +
    7328 }
    +
    7329 
    +
    7330 static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7331 {
    +
    7332  return stbi__gif_info_raw(s, x, y, comp);
    +
    7333 }
    +
    7334 #endif
    +
    7335 
    +
    7336 // *************************************************************************************************
    +
    7337 // Radiance RGBE HDR loader
    +
    7338 // originally by Nicolas Schulz
    +
    7339 #ifndef STBI_NO_HDR
    +
    7340 static int stbi__hdr_test_core(stbi__context *s, const char *signature)
    +
    7341 {
    +
    7342  int i;
    +
    7343  for (i = 0; signature[i]; ++i)
    +
    7344  if (stbi__get8(s) != signature[i])
    +
    7345  return 0;
    +
    7346  stbi__rewind(s);
    +
    7347  return 1;
    +
    7348 }
    +
    7349 
    +
    7350 static int stbi__hdr_test(stbi__context *s)
    +
    7351 {
    +
    7352  int r = stbi__hdr_test_core(s, "#?RADIANCE\n");
    +
    7353  stbi__rewind(s);
    +
    7354  if (!r) {
    +
    7355  r = stbi__hdr_test_core(s, "#?RGBE\n");
    +
    7356  stbi__rewind(s);
    +
    7357  }
    +
    7358  return r;
    +
    7359 }
    +
    7360 
    +
    7361 #define STBI__HDR_BUFLEN 1024
    +
    7362 static char *stbi__hdr_gettoken(stbi__context *z, char *buffer)
    +
    7363 {
    +
    7364  int len = 0;
    +
    7365  char c = '\0';
    +
    7366 
    +
    7367  c = (char)stbi__get8(z);
    +
    7368 
    +
    7369  while (!stbi__at_eof(z) && c != '\n') {
    +
    7370  buffer[len++] = c;
    +
    7371  if (len == STBI__HDR_BUFLEN - 1) {
    +
    7372  // flush to end of line
    +
    7373  while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
    +
    7374  ;
    +
    7375  break;
    +
    7376  }
    +
    7377  c = (char)stbi__get8(z);
    +
    7378  }
    +
    7379 
    +
    7380  buffer[len] = 0;
    +
    7381  return buffer;
    +
    7382 }
    +
    7383 
    +
    7384 static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
    +
    7385 {
    +
    7386  if (input[3] != 0) {
    +
    7387  float f1;
    +
    7388  // Exponent
    +
    7389  f1 = (float)ldexp(1.0f, input[3] - (int)(128 + 8));
    +
    7390  if (req_comp <= 2)
    +
    7391  output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
    +
    7392  else {
    +
    7393  output[0] = input[0] * f1;
    +
    7394  output[1] = input[1] * f1;
    +
    7395  output[2] = input[2] * f1;
    +
    7396  }
    +
    7397  if (req_comp == 2)
    +
    7398  output[1] = 1;
    +
    7399  if (req_comp == 4)
    +
    7400  output[3] = 1;
    +
    7401  } else {
    +
    7402  switch (req_comp) {
    +
    7403  case 4:
    +
    7404  output[3] = 1; /* fallthrough */
    +
    7405  case 3:
    +
    7406  output[0] = output[1] = output[2] = 0;
    +
    7407  break;
    +
    7408  case 2:
    +
    7409  output[1] = 1; /* fallthrough */
    +
    7410  case 1:
    +
    7411  output[0] = 0;
    +
    7412  break;
    +
    7413  }
    +
    7414  }
    +
    7415 }
    +
    7416 
    +
    7417 static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp,
    +
    7418  int req_comp, stbi__result_info *ri)
    +
    7419 {
    +
    7420  char buffer[STBI__HDR_BUFLEN];
    +
    7421  char *token;
    +
    7422  int valid = 0;
    +
    7423  int width, height;
    +
    7424  stbi_uc *scanline;
    +
    7425  float *hdr_data;
    +
    7426  int len;
    +
    7427  unsigned char count, value;
    +
    7428  int i, j, k, c1, c2, z;
    +
    7429  const char *headerToken;
    +
    7430  STBI_NOTUSED(ri);
    +
    7431 
    +
    7432  // Check identifier
    +
    7433  headerToken = stbi__hdr_gettoken(s, buffer);
    +
    7434  if (strcmp(headerToken, "#?RADIANCE") != 0 &&
    +
    7435  strcmp(headerToken, "#?RGBE") != 0)
    +
    7436  return stbi__errpf("not HDR", "Corrupt HDR image");
    +
    7437 
    +
    7438  // Parse header
    +
    7439  for (;;) {
    +
    7440  token = stbi__hdr_gettoken(s, buffer);
    +
    7441  if (token[0] == 0)
    +
    7442  break;
    +
    7443  if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0)
    +
    7444  valid = 1;
    +
    7445  }
    +
    7446 
    +
    7447  if (!valid)
    +
    7448  return stbi__errpf("unsupported format", "Unsupported HDR format");
    +
    7449 
    +
    7450  // Parse width and height
    +
    7451  // can't use sscanf() if we're not using stdio!
    +
    7452  token = stbi__hdr_gettoken(s, buffer);
    +
    7453  if (strncmp(token, "-Y ", 3))
    +
    7454  return stbi__errpf("unsupported data layout", "Unsupported HDR format");
    +
    7455  token += 3;
    +
    7456  height = (int)strtol(token, &token, 10);
    +
    7457  while (*token == ' ')
    +
    7458  ++token;
    +
    7459  if (strncmp(token, "+X ", 3))
    +
    7460  return stbi__errpf("unsupported data layout", "Unsupported HDR format");
    +
    7461  token += 3;
    +
    7462  width = (int)strtol(token, NULL, 10);
    +
    7463 
    +
    7464  *x = width;
    +
    7465  *y = height;
    +
    7466 
    +
    7467  if (comp)
    +
    7468  *comp = 3;
    +
    7469  if (req_comp == 0)
    +
    7470  req_comp = 3;
    +
    7471 
    +
    7472  if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0))
    +
    7473  return stbi__errpf("too large", "HDR image is too large");
    +
    7474 
    +
    7475  // Read data
    +
    7476  hdr_data =
    +
    7477  (float *)stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0);
    +
    7478  if (!hdr_data)
    +
    7479  return stbi__errpf("outofmem", "Out of memory");
    +
    7480 
    +
    7481  // Load image data
    +
    7482  // image data is stored as some number of sca
    +
    7483  if (width < 8 || width >= 32768) {
    +
    7484  // Read flat data
    +
    7485  for (j = 0; j < height; ++j) {
    +
    7486  for (i = 0; i < width; ++i) {
    +
    7487  stbi_uc rgbe[4];
    +
    7488  main_decode_loop:
    +
    7489  stbi__getn(s, rgbe, 4);
    +
    7490  stbi__hdr_convert(hdr_data + j * width * req_comp +
    +
    7491  i * req_comp,
    +
    7492  rgbe, req_comp);
    +
    7493  }
    +
    7494  }
    +
    7495  } else {
    +
    7496  // Read RLE-encoded data
    +
    7497  scanline = NULL;
    +
    7498 
    +
    7499  for (j = 0; j < height; ++j) {
    +
    7500  c1 = stbi__get8(s);
    +
    7501  c2 = stbi__get8(s);
    +
    7502  len = stbi__get8(s);
    +
    7503  if (c1 != 2 || c2 != 2 || (len & 0x80)) {
    +
    7504  // not run-length encoded, so we have to actually use THIS data
    +
    7505  // as a decoded pixel (note this can't be a valid pixel--one of
    +
    7506  // RGB must be >= 128)
    +
    7507  stbi_uc rgbe[4];
    +
    7508  rgbe[0] = (stbi_uc)c1;
    +
    7509  rgbe[1] = (stbi_uc)c2;
    +
    7510  rgbe[2] = (stbi_uc)len;
    +
    7511  rgbe[3] = (stbi_uc)stbi__get8(s);
    +
    7512  stbi__hdr_convert(hdr_data, rgbe, req_comp);
    +
    7513  i = 1;
    +
    7514  j = 0;
    +
    7515  STBI_FREE(scanline);
    +
    7516  goto main_decode_loop; // yes, this makes no sense
    +
    7517  }
    +
    7518  len <<= 8;
    +
    7519  len |= stbi__get8(s);
    +
    7520  if (len != width) {
    +
    7521  STBI_FREE(hdr_data);
    +
    7522  STBI_FREE(scanline);
    +
    7523  return stbi__errpf("invalid decoded scanline length",
    +
    7524  "corrupt HDR");
    +
    7525  }
    +
    7526  if (scanline == NULL) {
    +
    7527  scanline = (stbi_uc *)stbi__malloc_mad2(width, 4, 0);
    +
    7528  if (!scanline) {
    +
    7529  STBI_FREE(hdr_data);
    +
    7530  return stbi__errpf("outofmem", "Out of memory");
    +
    7531  }
    +
    7532  }
    +
    7533 
    +
    7534  for (k = 0; k < 4; ++k) {
    +
    7535  int nleft;
    +
    7536  i = 0;
    +
    7537  while ((nleft = width - i) > 0) {
    +
    7538  count = stbi__get8(s);
    +
    7539  if (count > 128) {
    +
    7540  // Run
    +
    7541  value = stbi__get8(s);
    +
    7542  count -= 128;
    +
    7543  if (count > nleft) {
    +
    7544  STBI_FREE(hdr_data);
    +
    7545  STBI_FREE(scanline);
    +
    7546  return stbi__errpf("corrupt",
    +
    7547  "bad RLE data in HDR");
    +
    7548  }
    +
    7549  for (z = 0; z < count; ++z)
    +
    7550  scanline[i++ * 4 + k] = value;
    +
    7551  } else {
    +
    7552  // Dump
    +
    7553  if (count > nleft) {
    +
    7554  STBI_FREE(hdr_data);
    +
    7555  STBI_FREE(scanline);
    +
    7556  return stbi__errpf("corrupt",
    +
    7557  "bad RLE data in HDR");
    +
    7558  }
    +
    7559  for (z = 0; z < count; ++z)
    +
    7560  scanline[i++ * 4 + k] = stbi__get8(s);
    +
    7561  }
    +
    7562  }
    +
    7563  }
    +
    7564  for (i = 0; i < width; ++i)
    +
    7565  stbi__hdr_convert(hdr_data + (j * width + i) * req_comp,
    +
    7566  scanline + i * 4, req_comp);
    +
    7567  }
    +
    7568  if (scanline)
    +
    7569  STBI_FREE(scanline);
    +
    7570  }
    +
    7571 
    +
    7572  return hdr_data;
    +
    7573 }
    +
    7574 
    +
    7575 static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7576 {
    +
    7577  char buffer[STBI__HDR_BUFLEN];
    +
    7578  char *token;
    +
    7579  int valid = 0;
    +
    7580  int dummy;
    +
    7581 
    +
    7582  if (!x)
    +
    7583  x = &dummy;
    +
    7584  if (!y)
    +
    7585  y = &dummy;
    +
    7586  if (!comp)
    +
    7587  comp = &dummy;
    +
    7588 
    +
    7589  if (stbi__hdr_test(s) == 0) {
    +
    7590  stbi__rewind(s);
    +
    7591  return 0;
    +
    7592  }
    +
    7593 
    +
    7594  for (;;) {
    +
    7595  token = stbi__hdr_gettoken(s, buffer);
    +
    7596  if (token[0] == 0)
    +
    7597  break;
    +
    7598  if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0)
    +
    7599  valid = 1;
    +
    7600  }
    +
    7601 
    +
    7602  if (!valid) {
    +
    7603  stbi__rewind(s);
    +
    7604  return 0;
    +
    7605  }
    +
    7606  token = stbi__hdr_gettoken(s, buffer);
    +
    7607  if (strncmp(token, "-Y ", 3)) {
    +
    7608  stbi__rewind(s);
    +
    7609  return 0;
    +
    7610  }
    +
    7611  token += 3;
    +
    7612  *y = (int)strtol(token, &token, 10);
    +
    7613  while (*token == ' ')
    +
    7614  ++token;
    +
    7615  if (strncmp(token, "+X ", 3)) {
    +
    7616  stbi__rewind(s);
    +
    7617  return 0;
    +
    7618  }
    +
    7619  token += 3;
    +
    7620  *x = (int)strtol(token, NULL, 10);
    +
    7621  *comp = 3;
    +
    7622  return 1;
    +
    7623 }
    +
    7624 #endif // STBI_NO_HDR
    +
    7625 
    +
    7626 #ifndef STBI_NO_BMP
    +
    7627 static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7628 {
    +
    7629  void *p;
    +
    7630  stbi__bmp_data info;
    +
    7631 
    +
    7632  info.all_a = 255;
    +
    7633  p = stbi__bmp_parse_header(s, &info);
    +
    7634  stbi__rewind(s);
    +
    7635  if (p == NULL)
    +
    7636  return 0;
    +
    7637  if (x)
    +
    7638  *x = s->img_x;
    +
    7639  if (y)
    +
    7640  *y = s->img_y;
    +
    7641  if (comp)
    +
    7642  *comp = info.ma ? 4 : 3;
    +
    7643  return 1;
    +
    7644 }
    +
    7645 #endif
    +
    7646 
    +
    7647 #ifndef STBI_NO_PSD
    +
    7648 static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7649 {
    +
    7650  int channelCount, dummy;
    +
    7651  if (!x)
    +
    7652  x = &dummy;
    +
    7653  if (!y)
    +
    7654  y = &dummy;
    +
    7655  if (!comp)
    +
    7656  comp = &dummy;
    +
    7657  if (stbi__get32be(s) != 0x38425053) {
    +
    7658  stbi__rewind(s);
    +
    7659  return 0;
    +
    7660  }
    +
    7661  if (stbi__get16be(s) != 1) {
    +
    7662  stbi__rewind(s);
    +
    7663  return 0;
    +
    7664  }
    +
    7665  stbi__skip(s, 6);
    +
    7666  channelCount = stbi__get16be(s);
    +
    7667  if (channelCount < 0 || channelCount > 16) {
    +
    7668  stbi__rewind(s);
    +
    7669  return 0;
    +
    7670  }
    +
    7671  *y = stbi__get32be(s);
    +
    7672  *x = stbi__get32be(s);
    +
    7673  if (stbi__get16be(s) != 8) {
    +
    7674  stbi__rewind(s);
    +
    7675  return 0;
    +
    7676  }
    +
    7677  if (stbi__get16be(s) != 3) {
    +
    7678  stbi__rewind(s);
    +
    7679  return 0;
    +
    7680  }
    +
    7681  *comp = 4;
    +
    7682  return 1;
    +
    7683 }
    +
    7684 #endif
    +
    7685 
    +
    7686 #ifndef STBI_NO_PIC
    +
    7687 static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7688 {
    +
    7689  int act_comp = 0, num_packets = 0, chained, dummy;
    +
    7690  stbi__pic_packet packets[10];
    +
    7691 
    +
    7692  if (!x)
    +
    7693  x = &dummy;
    +
    7694  if (!y)
    +
    7695  y = &dummy;
    +
    7696  if (!comp)
    +
    7697  comp = &dummy;
    +
    7698 
    +
    7699  if (!stbi__pic_is4(s, "\x53\x80\xF6\x34")) {
    +
    7700  stbi__rewind(s);
    +
    7701  return 0;
    +
    7702  }
    +
    7703 
    +
    7704  stbi__skip(s, 88);
    +
    7705 
    +
    7706  *x = stbi__get16be(s);
    +
    7707  *y = stbi__get16be(s);
    +
    7708  if (stbi__at_eof(s)) {
    +
    7709  stbi__rewind(s);
    +
    7710  return 0;
    +
    7711  }
    +
    7712  if ((*x) != 0 && (1 << 28) / (*x) < (*y)) {
    +
    7713  stbi__rewind(s);
    +
    7714  return 0;
    +
    7715  }
    +
    7716 
    +
    7717  stbi__skip(s, 8);
    +
    7718 
    +
    7719  do {
    +
    7720  stbi__pic_packet *packet;
    +
    7721 
    +
    7722  if (num_packets == sizeof(packets) / sizeof(packets[0]))
    +
    7723  return 0;
    +
    7724 
    +
    7725  packet = &packets[num_packets++];
    +
    7726  chained = stbi__get8(s);
    +
    7727  packet->size = stbi__get8(s);
    +
    7728  packet->type = stbi__get8(s);
    +
    7729  packet->channel = stbi__get8(s);
    +
    7730  act_comp |= packet->channel;
    +
    7731 
    +
    7732  if (stbi__at_eof(s)) {
    +
    7733  stbi__rewind(s);
    +
    7734  return 0;
    +
    7735  }
    +
    7736  if (packet->size != 8) {
    +
    7737  stbi__rewind(s);
    +
    7738  return 0;
    +
    7739  }
    +
    7740  } while (chained);
    +
    7741 
    +
    7742  *comp = (act_comp & 0x10 ? 4 : 3);
    +
    7743 
    +
    7744  return 1;
    +
    7745 }
    +
    7746 #endif
    +
    7747 
    +
    7748  // *************************************************************************************************
    +
    7749  // Portable Gray Map and Portable Pixel Map loader
    +
    7750  // by Ken Miller
    +
    7751  //
    +
    7752  // PGM: http://netpbm.sourceforge.net/doc/pgm.html
    +
    7753  // PPM: http://netpbm.sourceforge.net/doc/ppm.html
    +
    7754  //
    +
    7755  // Known limitations:
    +
    7756  // Does not support comments in the header section
    +
    7757  // Does not support ASCII image data (formats P2 and P3)
    +
    7758  // Does not support 16-bit-per-channel
    +
    7759 
    +
    7760 #ifndef STBI_NO_PNM
    +
    7761 
    +
    7762 static int stbi__pnm_test(stbi__context *s)
    +
    7763 {
    +
    7764  char p, t;
    +
    7765  p = (char)stbi__get8(s);
    +
    7766  t = (char)stbi__get8(s);
    +
    7767  if (p != 'P' || (t != '5' && t != '6')) {
    +
    7768  stbi__rewind(s);
    +
    7769  return 0;
    +
    7770  }
    +
    7771  return 1;
    +
    7772 }
    +
    7773 
    +
    7774 static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp,
    +
    7775  int req_comp, stbi__result_info *ri)
    +
    7776 {
    +
    7777  stbi_uc *out;
    +
    7778  STBI_NOTUSED(ri);
    +
    7779 
    +
    7780  if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y,
    +
    7781  (int *)&s->img_n))
    +
    7782  return 0;
    +
    7783 
    +
    7784  *x = s->img_x;
    +
    7785  *y = s->img_y;
    +
    7786  if (comp)
    +
    7787  *comp = s->img_n;
    +
    7788 
    +
    7789  if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0))
    +
    7790  return stbi__errpuc("too large", "PNM too large");
    +
    7791 
    +
    7792  out = (stbi_uc *)stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0);
    +
    7793  if (!out)
    +
    7794  return stbi__errpuc("outofmem", "Out of memory");
    +
    7795  stbi__getn(s, out, s->img_n * s->img_x * s->img_y);
    +
    7796 
    +
    7797  if (req_comp && req_comp != s->img_n) {
    +
    7798  out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
    +
    7799  if (out == NULL)
    +
    7800  return out; // stbi__convert_format frees input on failure
    +
    7801  }
    +
    7802  return out;
    +
    7803 }
    +
    7804 
    +
    7805 static int stbi__pnm_isspace(char c)
    +
    7806 {
    +
    7807  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
    +
    7808  c == '\r';
    +
    7809 }
    +
    7810 
    +
    7811 static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
    +
    7812 {
    +
    7813  for (;;) {
    +
    7814  while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
    +
    7815  *c = (char)stbi__get8(s);
    +
    7816 
    +
    7817  if (stbi__at_eof(s) || *c != '#')
    +
    7818  break;
    +
    7819 
    +
    7820  while (!stbi__at_eof(s) && *c != '\n' && *c != '\r')
    +
    7821  *c = (char)stbi__get8(s);
    +
    7822  }
    +
    7823 }
    +
    7824 
    +
    7825 static int stbi__pnm_isdigit(char c)
    +
    7826 {
    +
    7827  return c >= '0' && c <= '9';
    +
    7828 }
    +
    7829 
    +
    7830 static int stbi__pnm_getinteger(stbi__context *s, char *c)
    +
    7831 {
    +
    7832  int value = 0;
    +
    7833 
    +
    7834  while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
    +
    7835  value = value * 10 + (*c - '0');
    +
    7836  *c = (char)stbi__get8(s);
    +
    7837  }
    +
    7838 
    +
    7839  return value;
    +
    7840 }
    +
    7841 
    +
    7842 static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
    +
    7843 {
    +
    7844  int maxv, dummy;
    +
    7845  char c, p, t;
    +
    7846 
    +
    7847  if (!x)
    +
    7848  x = &dummy;
    +
    7849  if (!y)
    +
    7850  y = &dummy;
    +
    7851  if (!comp)
    +
    7852  comp = &dummy;
    +
    7853 
    +
    7854  stbi__rewind(s);
    +
    7855 
    +
    7856  // Get identifier
    +
    7857  p = (char)stbi__get8(s);
    +
    7858  t = (char)stbi__get8(s);
    +
    7859  if (p != 'P' || (t != '5' && t != '6')) {
    +
    7860  stbi__rewind(s);
    +
    7861  return 0;
    +
    7862  }
    +
    7863 
    +
    7864  *comp =
    +
    7865  (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm
    +
    7866 
    +
    7867  c = (char)stbi__get8(s);
    +
    7868  stbi__pnm_skip_whitespace(s, &c);
    +
    7869 
    +
    7870  *x = stbi__pnm_getinteger(s, &c); // read width
    +
    7871  stbi__pnm_skip_whitespace(s, &c);
    +
    7872 
    +
    7873  *y = stbi__pnm_getinteger(s, &c); // read height
    +
    7874  stbi__pnm_skip_whitespace(s, &c);
    +
    7875 
    +
    7876  maxv = stbi__pnm_getinteger(s, &c); // read max value
    +
    7877 
    +
    7878  if (maxv > 255)
    +
    7879  return stbi__err("max value > 255", "PPM image not 8-bit");
    +
    7880  else
    +
    7881  return 1;
    +
    7882 }
    +
    7883 #endif
    +
    7884 
    +
    7885 static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
    +
    7886 {
    +
    7887 #ifndef STBI_NO_JPEG
    +
    7888  if (stbi__jpeg_info(s, x, y, comp))
    +
    7889  return 1;
    +
    7890 #endif
    +
    7891 
    +
    7892 #ifndef STBI_NO_PNG
    +
    7893  if (stbi__png_info(s, x, y, comp))
    +
    7894  return 1;
    +
    7895 #endif
    +
    7896 
    +
    7897 #ifndef STBI_NO_GIF
    +
    7898  if (stbi__gif_info(s, x, y, comp))
    +
    7899  return 1;
    +
    7900 #endif
    +
    7901 
    +
    7902 #ifndef STBI_NO_BMP
    +
    7903  if (stbi__bmp_info(s, x, y, comp))
    +
    7904  return 1;
    +
    7905 #endif
    +
    7906 
    +
    7907 #ifndef STBI_NO_PSD
    +
    7908  if (stbi__psd_info(s, x, y, comp))
    +
    7909  return 1;
    +
    7910 #endif
    +
    7911 
    +
    7912 #ifndef STBI_NO_PIC
    +
    7913  if (stbi__pic_info(s, x, y, comp))
    +
    7914  return 1;
    +
    7915 #endif
    +
    7916 
    +
    7917 #ifndef STBI_NO_PNM
    +
    7918  if (stbi__pnm_info(s, x, y, comp))
    +
    7919  return 1;
    +
    7920 #endif
    +
    7921 
    +
    7922 #ifndef STBI_NO_HDR
    +
    7923  if (stbi__hdr_info(s, x, y, comp))
    +
    7924  return 1;
    +
    7925 #endif
    +
    7926 
    +
    7927 // test tga last because it's a crappy test!
    +
    7928 #ifndef STBI_NO_TGA
    +
    7929  if (stbi__tga_info(s, x, y, comp))
    +
    7930  return 1;
    +
    7931 #endif
    +
    7932  return stbi__err("unknown image type",
    +
    7933  "Image not of any known type, or corrupt");
    +
    7934 }
    +
    7935 
    +
    7936 #ifndef STBI_NO_STDIO
    +
    7937 STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
    +
    7938 {
    +
    7939  FILE *f = stbi__fopen(filename, "rb");
    +
    7940  int result;
    +
    7941  if (!f)
    +
    7942  return stbi__err("can't fopen", "Unable to open file");
    +
    7943  result = stbi_info_from_file(f, x, y, comp);
    +
    7944  fclose(f);
    +
    7945  return result;
    +
    7946 }
    +
    7947 
    +
    7948 STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
    +
    7949 {
    +
    7950  int r;
    +
    7951  stbi__context s;
    +
    7952  long pos = ftell(f);
    +
    7953  stbi__start_file(&s, f);
    +
    7954  r = stbi__info_main(&s, x, y, comp);
    +
    7955  fseek(f, pos, SEEK_SET);
    +
    7956  return r;
    +
    7957 }
    +
    7958 #endif // !STBI_NO_STDIO
    +
    7959 
    +
    7960 STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x,
    +
    7961  int *y, int *comp)
    +
    7962 {
    +
    7963  stbi__context s;
    +
    7964  stbi__start_mem(&s, buffer, len);
    +
    7965  return stbi__info_main(&s, x, y, comp);
    +
    7966 }
    +
    7967 
    +
    7968 STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user,
    +
    7969  int *x, int *y, int *comp)
    +
    7970 {
    +
    7971  stbi__context s;
    +
    7972  stbi__start_callbacks(&s, (stbi_io_callbacks *)c, user);
    +
    7973  return stbi__info_main(&s, x, y, comp);
    +
    7974 }
    +
    7975 
    +
    7976 #endif // STB_IMAGE_IMPLEMENTATION
    +
    7977 
    +
    7978 /*
    +
    7979  revision history:
    +
    7980  2.16 (2017-07-23) all functions have 16-bit variants;
    +
    7981  STBI_NO_STDIO works again;
    +
    7982  compilation fixes;
    +
    7983  fix rounding in unpremultiply;
    +
    7984  optimize vertical flip;
    +
    7985  disable raw_len validation;
    +
    7986  documentation fixes
    +
    7987  2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
    +
    7988  warning fixes; disable run-time SSE detection on gcc;
    +
    7989  uniform handling of optional "return" values;
    +
    7990  thread-safe initialization of zlib tables
    +
    7991  2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet
    +
    7992  JPGs 2.13 (2016-11-29) add 16-bit API, only supported for PNG right now 2.12
    +
    7993  (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11 (2016-04-02)
    +
    7994  allocate large structures on the stack remove white matting for transparent
    +
    7995  PSD fix reported channel count for PNG & BMP re-enable SSE2 in non-gcc 64-bit
    +
    7996  support RGB-formatted JPEG
    +
    7997  read 16-bit PNGs (only as 8-bit)
    +
    7998  2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED
    +
    7999  2.09 (2016-01-16) allow comments in PNM files
    +
    8000  16-bit-per-pixel TGA (not bit-per-component)
    +
    8001  info() for TGA could break due to .hdr handling
    +
    8002  info() for BMP to shares code instead of sloppy parse
    +
    8003  can use STBI_REALLOC_SIZED if allocator doesn't support
    +
    8004  realloc code cleanup 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD
    +
    8005  as RGBA 2.07 (2015-09-13) fix compiler warnings partial animated GIF support
    +
    8006  limited 16-bpc PSD support
    +
    8007  #ifdef unused functions
    +
    8008  bug with < 92 byte PIC,PNM,HDR,TGA
    +
    8009  2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
    +
    8010  2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
    +
    8011  2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
    +
    8012  2.03 (2015-04-12) extra corruption checking (mmozeiko)
    +
    8013  stbi_set_flip_vertically_on_load (nguillemot)
    +
    8014  fix NEON support; fix mingw support
    +
    8015  2.02 (2015-01-19) fix incorrect assert, fix warning
    +
    8016  2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit
    +
    8017  without -msse2 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG 2.00
    +
    8018  (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg) progressive
    +
    8019  JPEG (stb) PGM/PPM support (Ken Miller) STBI_MALLOC,STBI_REALLOC,STBI_FREE
    +
    8020  GIF bugfix -- seemingly never worked
    +
    8021  STBI_NO_*, STBI_ONLY_*
    +
    8022  1.48 (2014-12-14) fix incorrectly-named assert()
    +
    8023  1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar
    +
    8024  Cornut & stb) optimize PNG (ryg) fix bug in interlaced PNG with
    +
    8025  user-specified channel count (stb) 1.46 (2014-08-26) fix broken tRNS chunk
    +
    8026  (colorkey-style transparency) in non-paletted PNG 1.45 (2014-08-16) fix
    +
    8027  MSVC-ARM internal compiler error by wrapping malloc 1.44 (2014-08-07)
    +
    8028  various warning fixes from Ronny Chevalier
    +
    8029  1.43 (2014-07-15)
    +
    8030  fix MSVC-only compiler problem in code changed in 1.42
    +
    8031  1.42 (2014-07-09)
    +
    8032  don't define _CRT_SECURE_NO_WARNINGS (affects user code)
    +
    8033  fixes to stbi__cleanup_jpeg path
    +
    8034  added STBI_ASSERT to avoid requiring assert.h
    +
    8035  1.41 (2014-06-25)
    +
    8036  fix search&replace from 1.36 that messed up comments/error
    +
    8037  messages 1.40 (2014-06-22) fix gcc struct-initialization warning 1.39
    +
    8038  (2014-06-15) fix to TGA optimization when req_comp != number of components in
    +
    8039  TGA; fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my
    +
    8040  test suite) add support for BMP version 5 (more ignored fields) 1.38
    +
    8041  (2014-06-06) suppress MSVC warnings on integer casts truncating values fix
    +
    8042  accidental rename of 'skip' field of I/O 1.37 (2014-06-04) remove duplicate
    +
    8043  typedef 1.36 (2014-06-03) convert to header file single-file library if
    +
    8044  de-iphone isn't set, load iphone images color-swapped instead of returning
    +
    8045  NULL 1.35 (2014-05-27) various warnings fix broken STBI_SIMD path fix bug
    +
    8046  where stbi_load_from_file no longer left file pointer in correct place fix
    +
    8047  broken non-easy path for 32-bit BMP (possibly never used) TGA optimization by
    +
    8048  Arseny Kapoulkine 1.34 (unknown) use STBI_NOTUSED in
    +
    8049  stbi__resample_row_generic(), fix one more leak in tga failure case 1.33
    +
    8050  (2011-07-14) make stbi_is_hdr work in STBI_NO_HDR (as specified), minor
    +
    8051  compiler-friendly improvements 1.32 (2011-07-13) support for "info" function
    +
    8052  for all supported filetypes (SpartanJ) 1.31 (2011-06-20) a few more leak
    +
    8053  fixes, bug in PNG handling (SpartanJ) 1.30 (2011-06-11) added ability to
    +
    8054  load files via callbacks to accomidate custom input streams (Ben Wenger)
    +
    8055  removed deprecated format-specific test/load functions
    +
    8056  removed support for installable file formats (stbi_loader) --
    +
    8057  would have been broken for IO callbacks anyway error cases in bmp and tga
    +
    8058  give messages and don't leak (Raymond Barbiero, grisha) fix inefficiency in
    +
    8059  decoding 32-bit BMP (David Woo) 1.29 (2010-08-16) various warning fixes from
    +
    8060  Aurelien Pocheville 1.28 (2010-08-01) fix bug in GIF palette transparency
    +
    8061  (SpartanJ) 1.27 (2010-08-01) cast-to-stbi_uc to fix warnings 1.26
    +
    8062  (2010-07-24) fix bug in file buffering for PNG reported by SpartanJ 1.25
    +
    8063  (2010-07-17) refix trans_data warning (Won Chun) 1.24 (2010-07-12) perf
    +
    8064  improvements reading from files on platforms with lock-heavy fgetc() minor
    +
    8065  perf improvements for jpeg deprecated type-specific functions so we'll get
    +
    8066  feedback if they're needed attempt to fix trans_data warning (Won Chun) 1.23
    +
    8067  fixed bug in iPhone support 1.22 (2010-07-10) removed image *writing*
    +
    8068  support stbi_info support from Jetro Lauha GIF support from Jean-Marc Lienher
    +
    8069  iPhone PNG-extensions from James Brown
    +
    8070  warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err.
    +
    8071  Janez (U+017D)emva) 1.21 fix use of 'stbi_uc' in header (reported by jon
    +
    8072  blow) 1.20 added support for Softimage PIC, by Tom Seddon 1.19 bug in
    +
    8073  interlaced PNG corruption check (found by ryg) 1.18 (2008-08-02) fix a
    +
    8074  threading bug (local mutable static) 1.17 support interlaced PNG 1.16
    +
    8075  major bugfix - stbi__convert_format converted one too many pixels 1.15
    +
    8076  initialize some fields for thread safety 1.14 fix threadsafe conversion
    +
    8077  bug header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
    +
    8078  1.13 threadsafe
    +
    8079  1.12 const qualifiers in the API
    +
    8080  1.11 Support installable IDCT, colorspace conversion routines
    +
    8081  1.10 Fixes for 64-bit (don't use "unsigned long")
    +
    8082  optimized upsampling by Fabian "ryg" Giesen
    +
    8083  1.09 Fix format-conversion for PSD code (bad global variables!)
    +
    8084  1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
    +
    8085  1.07 attempt to fix C++ warning/errors again
    +
    8086  1.06 attempt to fix C++ warning/errors again
    +
    8087  1.05 fix TGA loading to return correct *comp and use good luminance
    +
    8088  calc 1.04 default float alpha is 1, not 255; use 'void *' for
    +
    8089  stbi_image_free 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR 1.02
    +
    8090  support for (subset of) HDR files, float interface for preferred access to
    +
    8091  them 1.01 fix bug: possible bug in handling right-side up bmps... not sure
    +
    8092  fix bug: the stbi__bmp_load() and stbi__tga_load() functions
    +
    8093  didn't work at all 1.00 interface to zlib that skips zlib header 0.99
    +
    8094  correct handling of alpha in palette 0.98 TGA loader by lonesock;
    +
    8095  dynamically add loaders (untested) 0.97 jpeg errors on too large a file;
    +
    8096  also catch another malloc failure 0.96 fix detection of invalid v value -
    +
    8097  particleman@mollyrocket forum 0.95 during header scan, seek to markers in
    +
    8098  case of padding 0.94 STBI_NO_STDIO to disable stdio usage; rename all
    +
    8099  #defines the same 0.93 handle jpegtran output; verbose errors 0.92 read
    +
    8100  4,8,16,24,32-bit BMP files of several formats 0.91 output 24-bit
    +
    8101  Windows 3.0 BMP files 0.90 fix a few more warnings; bump version number to
    +
    8102  approach 1.0 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd 0.60
    +
    8103  fix compiling as c++ 0.59 fix warnings: merge Dave Moore's -Wall fixes
    +
    8104  0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
    +
    8105  0.57 fix bug: jpg last huffman symbol before marker was >9 bits but
    +
    8106  less than 16 available 0.56 fix bug: zlib uncompressed mode len vs. nlen
    +
    8107  0.55 fix bug: restart_interval not initialized to 0
    +
    8108  0.54 allow NULL for 'int *comp'
    +
    8109  0.53 fix bug in png 3->4; speedup png decoding
    +
    8110  0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
    +
    8111  0.51 obey req_comp requests, 1-component jpegs return as 1-component,
    +
    8112  on 'test' only check type, not whether we support this variant
    +
    8113  0.50 (2006-11-19)
    +
    8114  first released version
    +
    8115 */
    +
    8116 
    +
    8117 /*
    +
    8118 ------------------------------------------------------------------------------
    +
    8119 This software is available under 2 licenses -- choose whichever you prefer.
    +
    8120 ------------------------------------------------------------------------------
    +
    8121 ALTERNATIVE A - MIT License
    +
    8122 Copyright (c) 2017 Sean Barrett
    +
    8123 Permission is hereby granted, free of charge, to any person obtaining a copy of
    +
    8124 this software and associated documentation files (the "Software"), to deal in
    +
    8125 the Software without restriction, including without limitation the rights to
    +
    8126 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    +
    8127 of the Software, and to permit persons to whom the Software is furnished to do
    +
    8128 so, subject to the following conditions:
    +
    8129 The above copyright notice and this permission notice shall be included in all
    +
    8130 copies or substantial portions of the Software.
    +
    8131 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +
    8132 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +
    8133 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +
    8134 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +
    8135 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +
    8136 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +
    8137 SOFTWARE.
    +
    8138 ------------------------------------------------------------------------------
    +
    8139 ALTERNATIVE B - Public Domain (www.unlicense.org)
    +
    8140 This is free and unencumbered software released into the public domain.
    +
    8141 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
    +
    8142 software, either in source code form or as a compiled binary, for any purpose,
    +
    8143 commercial or non-commercial, and by any means.
    +
    8144 In jurisdictions that recognize copyright laws, the author or authors of this
    +
    8145 software dedicate any and all copyright interest in the software to the public
    +
    8146 domain. We make this dedication for the benefit of the public at large and to
    +
    8147 the detriment of our heirs and successors. We intend this dedication to be an
    +
    8148 overt act of relinquishment in perpetuity of all present and future rights to
    +
    8149 this software under copyright law.
    +
    8150 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +
    8151 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +
    8152 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +
    8153 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    +
    8154 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    +
    8155 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
    8156 ------------------------------------------------------------------------------
    +
    8157 */
    #define STBIDEF
    Definition: stb_image.h:330
    STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
    @@ -7333,15 +8287,11 @@ $(document).ready(function(){initNavTree('stb__image_8h_source.html','');});
    STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
    STBIDEF char * stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
    -
    - + diff --git a/structstbi__io__callbacks-members.html b/structstbi__io__callbacks-members.html index a07671f6..7e214b15 100644 --- a/structstbi__io__callbacks-members.html +++ b/structstbi__io__callbacks-members.html @@ -8,13 +8,6 @@ - - - - -
    +
    stbi_io_callbacks Member List
    @@ -117,14 +97,11 @@ $(document).ready(function(){initNavTree('structstbi__io__callbacks.html','');}) readstbi_io_callbacks skipstbi_io_callbacks
    - - + diff --git a/structstbi__io__callbacks.html b/structstbi__io__callbacks.html index a5e6f7f4..b7256eba 100644 --- a/structstbi__io__callbacks.html +++ b/structstbi__io__callbacks.html @@ -8,13 +8,6 @@ - - - - -
    +
    Public Attributes | @@ -166,15 +146,11 @@ Public Attributes
  • yage/core/stb_image.h
  • -
    - + diff --git a/structstbi__io__callbacks.js b/structstbi__io__callbacks.js deleted file mode 100644 index 67604146..00000000 --- a/structstbi__io__callbacks.js +++ /dev/null @@ -1,6 +0,0 @@ -var structstbi__io__callbacks = -[ - [ "eof", "structstbi__io__callbacks.html#a2c4f3c3b7c75a2e74a35caf74fb8d177", null ], - [ "read", "structstbi__io__callbacks.html#a73818f0a4f467e5abfefb1d635f62d82", null ], - [ "skip", "structstbi__io__callbacks.html#a864be557872041ac06e1509caf05cc83", null ] -]; \ No newline at end of file diff --git a/structyage_1_1Colour-members.html b/structyage_1_1Colour-members.html index 9cb2d796..d84d2eac 100644 --- a/structyage_1_1Colour-members.html +++ b/structyage_1_1Colour-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Colour Member List
    @@ -120,14 +104,11 @@ $(document).ready(function(){initNavTree('structyage_1_1Colour.html','');}); gyage::Colour ryage::Colour
    - - + diff --git a/structyage_1_1Colour.html b/structyage_1_1Colour.html index 658afc93..8baea207 100644 --- a/structyage_1_1Colour.html +++ b/structyage_1_1Colour.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -258,15 +242,11 @@ Public Attributes
  • yage/data/vertex.h
  • -
    - + diff --git a/structyage_1_1Colour.js b/structyage_1_1Colour.js deleted file mode 100644 index fc306acd..00000000 --- a/structyage_1_1Colour.js +++ /dev/null @@ -1,9 +0,0 @@ -var structyage_1_1Colour = -[ - [ "Colour", "structyage_1_1Colour.html#a585165d5109c81b6b2de6f1116406abd", null ], - [ "Colour", "structyage_1_1Colour.html#a8118ad802db7e61df770f7d3b5b88aaa", null ], - [ "a", "structyage_1_1Colour.html#a5aef37a5ac37e44dc32f5f9b1ebee10c", null ], - [ "b", "structyage_1_1Colour.html#a7bd3ed4a377c384af80aa8c7f55dc96f", null ], - [ "g", "structyage_1_1Colour.html#a205d3a63268f4879adf27aabdf71a6dd", null ], - [ "r", "structyage_1_1Colour.html#a572fe7933c59ebfa6720088cd33dad99", null ] -]; \ No newline at end of file diff --git a/structyage_1_1LogMessage_1_1Meta-members.html b/structyage_1_1LogMessage_1_1Meta-members.html index 62970f99..bf9ceaee 100644 --- a/structyage_1_1LogMessage_1_1Meta-members.html +++ b/structyage_1_1LogMessage_1_1Meta-members.html @@ -8,13 +8,6 @@ - - - - -
    yage::LogMessage::Meta Member List
    @@ -117,14 +101,11 @@ $(document).ready(function(){initNavTree('structyage_1_1LogMessage_1_1Meta.html' levelyage::LogMessage::Meta lineyage::LogMessage::Meta
    - - + diff --git a/structyage_1_1LogMessage_1_1Meta.html b/structyage_1_1LogMessage_1_1Meta.html index 5a84c551..8002c06c 100644 --- a/structyage_1_1LogMessage_1_1Meta.html +++ b/structyage_1_1LogMessage_1_1Meta.html @@ -8,13 +8,6 @@ - - - - -
    Public Attributes | @@ -166,15 +150,11 @@ Public Attributes
  • yage/core/logmessage.h
  • -
    - + diff --git a/structyage_1_1LogMessage_1_1Meta.js b/structyage_1_1LogMessage_1_1Meta.js deleted file mode 100644 index 466e08bf..00000000 --- a/structyage_1_1LogMessage_1_1Meta.js +++ /dev/null @@ -1,6 +0,0 @@ -var structyage_1_1LogMessage_1_1Meta = -[ - [ "fileName", "structyage_1_1LogMessage_1_1Meta.html#ae3ef1b01f47ef6254b8aa6fce13db7c4", null ], - [ "level", "structyage_1_1LogMessage_1_1Meta.html#aa265c76e7ce54e4b912e1c41333fad3b", null ], - [ "line", "structyage_1_1LogMessage_1_1Meta.html#ac2951995b1f4ebf28e94bcd268c3dd3c", null ] -]; \ No newline at end of file diff --git a/structyage_1_1Position-members.html b/structyage_1_1Position-members.html index 8ffbfbad..a181e0cb 100644 --- a/structyage_1_1Position-members.html +++ b/structyage_1_1Position-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Position Member List
    @@ -118,14 +102,11 @@ $(document).ready(function(){initNavTree('structyage_1_1Position.html','');}); xyage::Position yyage::Position
    - - + diff --git a/structyage_1_1Position.html b/structyage_1_1Position.html index bc28e553..008efdb9 100644 --- a/structyage_1_1Position.html +++ b/structyage_1_1Position.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -218,15 +202,11 @@ Public Attributes
  • yage/data/vertex.h
  • -
    - + diff --git a/structyage_1_1Position.js b/structyage_1_1Position.js deleted file mode 100644 index 1b25a716..00000000 --- a/structyage_1_1Position.js +++ /dev/null @@ -1,7 +0,0 @@ -var structyage_1_1Position = -[ - [ "Position", "structyage_1_1Position.html#a41b1d5ee23c50208982ab6089708e5d2", null ], - [ "Position", "structyage_1_1Position.html#aaeaa1cd93e57adcb08ef4f76513148e2", null ], - [ "x", "structyage_1_1Position.html#a4f5904d6d7b22802211f0565bc9f6c91", null ], - [ "y", "structyage_1_1Position.html#a45b8cc8245d0e05bb9e482d85512ee27", null ] -]; \ No newline at end of file diff --git a/structyage_1_1Texture-members.html b/structyage_1_1Texture-members.html index 8aebade9..85b8e337 100644 --- a/structyage_1_1Texture-members.html +++ b/structyage_1_1Texture-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Texture Member List
    @@ -121,14 +105,11 @@ $(document).ready(function(){initNavTree('structyage_1_1Texture.html','');}); xyage::Texture yyage::Texture
    - - + diff --git a/structyage_1_1Texture.html b/structyage_1_1Texture.html index 38ba6d56..a09c8cce 100644 --- a/structyage_1_1Texture.html +++ b/structyage_1_1Texture.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -278,15 +262,11 @@ Public Attributes
  • yage/data/texture.h
  • -
    - + diff --git a/structyage_1_1Texture.js b/structyage_1_1Texture.js deleted file mode 100644 index cf8f3ae1..00000000 --- a/structyage_1_1Texture.js +++ /dev/null @@ -1,10 +0,0 @@ -var structyage_1_1Texture = -[ - [ "Texture", "structyage_1_1Texture.html#a0cef080bceaaf5e702985f5494ea35d5", null ], - [ "Texture", "structyage_1_1Texture.html#af0a85aa4202d12fca9c1f52085d26850", null ], - [ "height", "structyage_1_1Texture.html#a5ce16ac8ad034f7042620a418783b41e", null ], - [ "id", "structyage_1_1Texture.html#a26386c2709b906ec07c9a1bb8daf2968", null ], - [ "width", "structyage_1_1Texture.html#ad42f41cc57ed7a20928382f6557dc598", null ], - [ "x", "structyage_1_1Texture.html#a7ecf257a7663cb0523d41c0519380046", null ], - [ "y", "structyage_1_1Texture.html#a4bfae86da1ef1930238291660223a8f0", null ] -]; \ No newline at end of file diff --git a/structyage_1_1UV-members.html b/structyage_1_1UV-members.html index 37d394dc..547b9cb7 100644 --- a/structyage_1_1UV-members.html +++ b/structyage_1_1UV-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::UV Member List
    @@ -118,14 +102,11 @@ $(document).ready(function(){initNavTree('structyage_1_1UV.html','');}); UV(float u_, float v_)yage::UVinline vyage::UV
    - - + diff --git a/structyage_1_1UV.html b/structyage_1_1UV.html index a52e3370..a0fede42 100644 --- a/structyage_1_1UV.html +++ b/structyage_1_1UV.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -218,15 +202,11 @@ Public Attributes
  • yage/data/vertex.h
  • -
    - + diff --git a/structyage_1_1UV.js b/structyage_1_1UV.js deleted file mode 100644 index e59172db..00000000 --- a/structyage_1_1UV.js +++ /dev/null @@ -1,7 +0,0 @@ -var structyage_1_1UV = -[ - [ "UV", "structyage_1_1UV.html#ae236139f3a5f6024aac1e21bd93b7bde", null ], - [ "UV", "structyage_1_1UV.html#ac918524789292937aae5803df3c2673f", null ], - [ "u", "structyage_1_1UV.html#aa726c11ba59a9a5edffef27ac3845053", null ], - [ "v", "structyage_1_1UV.html#a414dc7aeeebf47df1a991aacbb12a793", null ] -]; \ No newline at end of file diff --git a/structyage_1_1Vertex-members.html b/structyage_1_1Vertex-members.html index 161ed75b..2df0bd7f 100644 --- a/structyage_1_1Vertex-members.html +++ b/structyage_1_1Vertex-members.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage::Vertex Member List
    @@ -122,14 +106,11 @@ $(document).ready(function(){initNavTree('structyage_1_1Vertex.html','');}); Vertex()=defaultyage::Vertex Vertex(const Position &position_, const Colour &colour_, const UV &uv_)yage::Vertexinline
    - - + diff --git a/structyage_1_1Vertex.html b/structyage_1_1Vertex.html index a2d3bbe2..4d7ae694 100644 --- a/structyage_1_1Vertex.html +++ b/structyage_1_1Vertex.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Public Member Functions | @@ -359,15 +343,11 @@ Public Attributes
  • yage/data/vertex.h
  • -
    - + diff --git a/structyage_1_1Vertex.js b/structyage_1_1Vertex.js deleted file mode 100644 index 3ff142ac..00000000 --- a/structyage_1_1Vertex.js +++ /dev/null @@ -1,11 +0,0 @@ -var structyage_1_1Vertex = -[ - [ "Vertex", "structyage_1_1Vertex.html#acae9697c2762e37dfa4472b85fa112c3", null ], - [ "Vertex", "structyage_1_1Vertex.html#aac3046359c44aeabc910a81f4f41789e", null ], - [ "setColour", "structyage_1_1Vertex.html#aa759435739e34e2a0bfd1803c2aeeddf", null ], - [ "setPosition", "structyage_1_1Vertex.html#af392248f0be173221ebcc62d490fe03d", null ], - [ "setUv", "structyage_1_1Vertex.html#aa1fa8f5ebd883068828466cc924d4c50", null ], - [ "colour", "structyage_1_1Vertex.html#a142db28be39f418a06fa43f75d386182", null ], - [ "position", "structyage_1_1Vertex.html#abefe88d26b055655f9cc038a1dd4ff6a", null ], - [ "uv", "structyage_1_1Vertex.html#a2d1923353f0e50e7753ff1ae2d9ba84e", null ] -]; \ No newline at end of file diff --git a/structyage_1_1details_1_1Coordinate-members.html b/structyage_1_1details_1_1Coordinate-members.html index 9e40b659..559e162a 100644 --- a/structyage_1_1details_1_1Coordinate-members.html +++ b/structyage_1_1details_1_1Coordinate-members.html @@ -8,13 +8,6 @@ - - - - -
    yage::details::Coordinate Member List
    @@ -120,14 +104,11 @@ $(document).ready(function(){initNavTree('structyage_1_1details_1_1Coordinate.ht xyage::details::Coordinate yyage::details::Coordinate
    - - + diff --git a/structyage_1_1details_1_1Coordinate.html b/structyage_1_1details_1_1Coordinate.html index b46824ea..5367a38f 100644 --- a/structyage_1_1details_1_1Coordinate.html +++ b/structyage_1_1details_1_1Coordinate.html @@ -8,13 +8,6 @@ - - - - -
    Public Member Functions | @@ -258,15 +242,11 @@ Public Attributes
  • yage/core/spritesheet.h
  • -
    - + diff --git a/structyage_1_1details_1_1Coordinate.js b/structyage_1_1details_1_1Coordinate.js deleted file mode 100644 index ab984b7b..00000000 --- a/structyage_1_1details_1_1Coordinate.js +++ /dev/null @@ -1,9 +0,0 @@ -var structyage_1_1details_1_1Coordinate = -[ - [ "Coordinate", "structyage_1_1details_1_1Coordinate.html#a0b3a6d9aa1d5b846ad7ebc11bc77c629", null ], - [ "Coordinate", "structyage_1_1details_1_1Coordinate.html#a43fb6bd3e325d5cd7ec436778605db2a", null ], - [ "height", "structyage_1_1details_1_1Coordinate.html#a23585afbdaa9bb742353a4c90878a941", null ], - [ "width", "structyage_1_1details_1_1Coordinate.html#aed145c923c95f852a8fb3abde8e346c0", null ], - [ "x", "structyage_1_1details_1_1Coordinate.html#aa1a9203c0a9cd929f333bd99af634adc", null ], - [ "y", "structyage_1_1details_1_1Coordinate.html#a6d54c056ec7bd3c7ed1c6a226c2cf508", null ] -]; \ No newline at end of file diff --git a/structyage_1_1details_1_1Glyph-members.html b/structyage_1_1details_1_1Glyph-members.html index 70df2097..e395d31d 100644 --- a/structyage_1_1details_1_1Glyph-members.html +++ b/structyage_1_1details_1_1Glyph-members.html @@ -8,13 +8,6 @@ - - - - -
    yage::details::Glyph Member List
    @@ -121,14 +105,11 @@ $(document).ready(function(){initNavTree('structyage_1_1details_1_1Glyph.html',' top_leftyage::details::Glyph top_rightyage::details::Glyph
    - - + diff --git a/structyage_1_1details_1_1Glyph.html b/structyage_1_1details_1_1Glyph.html index f88546bc..293e32f9 100644 --- a/structyage_1_1details_1_1Glyph.html +++ b/structyage_1_1details_1_1Glyph.html @@ -8,13 +8,6 @@ - - - - -
    Public Member Functions | @@ -278,15 +262,11 @@ Public Attributes
  • yage/render/spritebatch.h
  • -
    - + diff --git a/structyage_1_1details_1_1Glyph.js b/structyage_1_1details_1_1Glyph.js deleted file mode 100644 index 2a5ef54c..00000000 --- a/structyage_1_1details_1_1Glyph.js +++ /dev/null @@ -1,10 +0,0 @@ -var structyage_1_1details_1_1Glyph = -[ - [ "Glyph", "structyage_1_1details_1_1Glyph.html#a91752b58fc10fb037658f27c9338627c", null ], - [ "bottom_left", "structyage_1_1details_1_1Glyph.html#ac42b2ed4a9179c38196953ed32bfa056", null ], - [ "bottom_right", "structyage_1_1details_1_1Glyph.html#a9de1d469f98aa0411f8073fdc3aa39ed", null ], - [ "depth", "structyage_1_1details_1_1Glyph.html#ae5398583bd0b4c1d6b334bf3902903d9", null ], - [ "texture", "structyage_1_1details_1_1Glyph.html#aba58f02d34ba363ab3435e2328e4bfcc", null ], - [ "top_left", "structyage_1_1details_1_1Glyph.html#a4dd2989e7b2a6d58dea6c85a9a1ed80d", null ], - [ "top_right", "structyage_1_1details_1_1Glyph.html#a503ba9786cf0fe3535e968b607a001da", null ] -]; \ No newline at end of file diff --git a/structyage_1_1details_1_1RenderBatch-members.html b/structyage_1_1details_1_1RenderBatch-members.html index dd213480..e8c2c012 100644 --- a/structyage_1_1details_1_1RenderBatch-members.html +++ b/structyage_1_1details_1_1RenderBatch-members.html @@ -8,13 +8,6 @@ - - - - -
    yage::details::RenderBatch Member List
    @@ -118,14 +102,11 @@ $(document).ready(function(){initNavTree('structyage_1_1details_1_1RenderBatch.h RenderBatch(GLint offset_i, GLsizei num_vertices_i, GLuint texture_i)yage::details::RenderBatchinline textureyage::details::RenderBatch
    - - + diff --git a/structyage_1_1details_1_1RenderBatch.html b/structyage_1_1details_1_1RenderBatch.html index d8eabfdc..ef956d84 100644 --- a/structyage_1_1details_1_1RenderBatch.html +++ b/structyage_1_1details_1_1RenderBatch.html @@ -8,13 +8,6 @@ - - - - -
    Public Member Functions | @@ -213,15 +197,11 @@ Public Attributes
  • yage/render/spritebatch.h
  • -
    - + diff --git a/structyage_1_1details_1_1RenderBatch.js b/structyage_1_1details_1_1RenderBatch.js deleted file mode 100644 index 797fe5b8..00000000 --- a/structyage_1_1details_1_1RenderBatch.js +++ /dev/null @@ -1,7 +0,0 @@ -var structyage_1_1details_1_1RenderBatch = -[ - [ "RenderBatch", "structyage_1_1details_1_1RenderBatch.html#a48f630fdb7c1a3f4eecd05996b560844", null ], - [ "num_vertices", "structyage_1_1details_1_1RenderBatch.html#a27ed6f3911a6d7c8c2b6b4e5a5889b29", null ], - [ "offset", "structyage_1_1details_1_1RenderBatch.html#a7f58b6967f0a68aa5624e0504c78a422", null ], - [ "texture", "structyage_1_1details_1_1RenderBatch.html#abf26b15420f34052270a1204d89ee687", null ] -]; \ No newline at end of file diff --git a/sync_off.png b/sync_off.png index 3b443fc6..b255e87b 100644 Binary files a/sync_off.png and b/sync_off.png differ diff --git a/sync_on.png b/sync_on.png index e08320fb..ff9d7d4a 100644 Binary files a/sync_on.png and b/sync_on.png differ diff --git a/syncqueue_8h.html b/syncqueue_8h.html index 9aaeaf60..d85c0777 100644 --- a/syncqueue_8h.html +++ b/syncqueue_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -129,7 +113,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -137,15 +121,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/syncqueue_8h_source.html b/syncqueue_8h_source.html index 7759e39f..30764da8 100644 --- a/syncqueue_8h_source.html +++ b/syncqueue_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    syncqueue.h
    @@ -197,15 +181,11 @@ $(document).ready(function(){initNavTree('syncqueue_8h_source.html','');});
    Definition: syncqueue.h:20
    - - + diff --git a/system_8h.html b/system_8h.html new file mode 100644 index 00000000..e40eb333 --- /dev/null +++ b/system_8h.html @@ -0,0 +1,129 @@ + + + + + + +YAGE: yage/engine/system.h File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + + +
    +
    + +
    +
    system.h File Reference
    +
    +
    + +


    + +More...

    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  yage::System
     System interface for the different systems in the engine. More...
     
    + + + + +

    +Namespaces

     yage
     Core includes.
     
    +

    Detailed Description

    +

    +

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    +

    MIT License, see LICENSE file for more details.

    +
    + + + + diff --git a/system_8h_source.html b/system_8h_source.html new file mode 100644 index 00000000..500a888d --- /dev/null +++ b/system_8h_source.html @@ -0,0 +1,129 @@ + + + + + + +YAGE: yage/engine/system.h Source File + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + + +
    +
    +
    +
    system.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    9 #ifndef YAGE_ENGINE_SYSTEM_H
    +
    10 #define YAGE_ENGINE_SYSTEM_H
    +
    11 
    +
    12 namespace yage
    +
    13 {
    +
    14 
    +
    18 class System
    +
    19 {
    +
    20 public:
    +
    25  virtual ~System() = 0;
    +
    26 
    +
    31  virtual void init() = 0;
    +
    32 
    +
    38  virtual void update(double dt) = 0;
    +
    39 };
    +
    40 
    +
    48 inline System::~System() {}
    +
    49 
    +
    50 } // namespace yage
    +
    51 
    +
    52 #endif
    +
    System interface for the different systems in the engine.
    Definition: system.h:18
    +
    virtual void init()=0
    Initializes the system.
    +
    virtual ~System()=0
    Virtual destructor to destroy all the objects that implement this properly.
    Definition: system.h:48
    +
    virtual void update(double dt)=0
    Updates the system at each interval using the time step.
    +
    + + + + diff --git a/tab_a.png b/tab_a.png index 3b725c41..bae36fc2 100644 Binary files a/tab_a.png and b/tab_a.png differ diff --git a/tab_b.png b/tab_b.png index e2b4a863..2851c408 100644 Binary files a/tab_b.png and b/tab_b.png differ diff --git a/tab_h.png b/tab_h.png index fd5cb705..afe5ff53 100644 Binary files a/tab_h.png and b/tab_h.png differ diff --git a/tab_s.png b/tab_s.png index ab478c95..606bca4b 100644 Binary files a/tab_s.png and b/tab_s.png differ diff --git a/tabs.css b/tabs.css index 9cf578f2..79cde398 100644 --- a/tabs.css +++ b/tabs.css @@ -34,7 +34,7 @@ background-image:url('tab_s.png'); background-repeat:no-repeat; background-position:right; - color: #283A5D; + color: #77280E; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; outline: none; diff --git a/texture_8h.html b/texture_8h.html index cde517c9..bb82e02b 100644 --- a/texture_8h.html +++ b/texture_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -127,7 +111,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -135,15 +119,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/texture_8h_source.html b/texture_8h_source.html index 1e7452d2..081da26b 100644 --- a/texture_8h_source.html +++ b/texture_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    texture.h
    @@ -144,15 +128,11 @@ $(document).ready(function(){initNavTree('texture_8h_source.html','');});
    Texture()
    Definition: texture.h:24
    GLuint id
    Definition: texture.h:18
    - - + diff --git a/texturecache_8cpp.html b/texturecache_8cpp.html index f8693123..4a430762 100644 --- a/texturecache_8cpp.html +++ b/texturecache_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -121,7 +105,7 @@ $(document).ready(function(){initNavTree('texturecache_8cpp.html','');});

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -129,15 +113,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/texturecache_8h.html b/texturecache_8h.html index 4d3d1bfd..51b56527 100644 --- a/texturecache_8h.html +++ b/texturecache_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -136,15 +120,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/texturecache_8h_source.html b/texturecache_8h_source.html index d1463e6a..78d723a8 100644 --- a/texturecache_8h_source.html +++ b/texturecache_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    texturecache.h
    @@ -140,15 +124,11 @@ $(document).ready(function(){initNavTree('texturecache_8h_source.html','');});
    Definition: texturecache.h:19
    Texture getTexture(const std::string &texture_path, int x=1, int y=1)
    Definition: texturecache.cpp:16
    - - + diff --git a/todo.html b/todo.html index 3f39f69f..db247e76 100644 --- a/todo.html +++ b/todo.html @@ -8,13 +8,6 @@ - - - - -
    +
    Todo List
    -
    Namespace yage
    +
    Namespace yage

    remove the include to make compilation faster

    think of removing this, by, for example, using a pointer This could be more efficient when copying the texture out of the spritesheet.

    -
    Member yage::Camera::update (Shader &program)
    +
    Member yage::Camera::update (Shader &program)
    Make this function more general to be able to be able to use any parametre in then shader as the camera matrix and not make it dependent on it being P.
    -
    Member yage::matrix::multiply (const Matrix< M, N, T > &m1, const Matrix< P, Q, T > &m2)
    +
    Member yage::matrix::multiply (const Matrix< M, N, T > &m1, const Matrix< P, Q, T > &m2)
    Think if this should be a static_assert.
    - - + diff --git a/todolist_8dox.html b/todolist_8dox.html deleted file mode 100644 index ad188793..00000000 --- a/todolist_8dox.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -YAGE: docs/todolist.dox File Reference - - - - - - - - - - - - - -
    -
    - - - - - - -
    -
    YAGE -  v0.1.4.0 -
    -
    Yet Another Game Engine
    -
    -
    - - - - - -
    -
    - -
    -
    -
    - - - - - - diff --git a/todolist_8md.html b/todolist_8md.html new file mode 100644 index 00000000..a9f6d8d8 --- /dev/null +++ b/todolist_8md.html @@ -0,0 +1,99 @@ + + + + + + +YAGE: docs/todolist.md File Reference + + + + + + + + + +
    +
    + + + + + + + +
    +
    YAGE +  v0.1.4.0 +
    +
    Yet Another Game Engine
    +
    +
    + + + + + + + + + +
    + +
    + +
    +
    +
    +
    docs/todolist.md File Reference
    +
    +
    +
    + + + + diff --git a/vertex_8h.html b/vertex_8h.html index ee83e802..e6fcfeb9 100644 --- a/vertex_8h.html +++ b/vertex_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -133,7 +117,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Detailed Description

    @@ -141,15 +125,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/vertex_8h_source.html b/vertex_8h_source.html index 3fa1904e..a326e740 100644 --- a/vertex_8h_source.html +++ b/vertex_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    vertex.h
    @@ -212,15 +196,11 @@ $(document).ready(function(){initNavTree('vertex_8h_source.html','');});
    Colour colour
    Definition: vertex.h:51
    float u
    Definition: vertex.h:41
    - - + diff --git a/window_8cpp.html b/window_8cpp.html index 9018c289..d797f911 100644 --- a/window_8cpp.html +++ b/window_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    @@ -116,14 +100,14 @@ $(document).ready(function(){initNavTree('window_8cpp.html','');}); More...

    #include "window.h"
    #include "../data/input.h"
    -#include <glad/glad.h>
    #include <GLFW/glfw3.h>
    +#include <glad/glad.h>
    #include <stdexcept>
    - +

    Namespaces

     yage
     Project namespace.
     Core includes.
     

    Detailed Description

    @@ -131,15 +115,11 @@ Namespaces

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/window_8h.html b/window_8h.html index 30257f5c..aa98c157 100644 --- a/window_8h.html +++ b/window_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Classes | @@ -128,7 +112,7 @@ Classes

    Namespaces

     yage - Project namespace.
    + Core includes.
     

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/window_8h.js b/window_8h.js deleted file mode 100644 index 6f21a916..00000000 --- a/window_8h.js +++ /dev/null @@ -1,10 +0,0 @@ -var window_8h = -[ - [ "Window", "classyage_1_1Window.html", "classyage_1_1Window" ], - [ "WindowFlags", "window_8h.html#a09d41deeced5fca5df9dc680c9e77c38", [ - [ "SHOWN", "window_8h.html#a09d41deeced5fca5df9dc680c9e77c38a7c4273d3feb1dc60a55a74c37c3fddd6", null ], - [ "HIDDEN", "window_8h.html#a09d41deeced5fca5df9dc680c9e77c38af7a4d995b268c416a6e01b8dc1555648", null ], - [ "FULLSCREEN", "window_8h.html#a09d41deeced5fca5df9dc680c9e77c38a409ae568f380139ffa38d7fffa5ffb2f", null ], - [ "BORDERLESS", "window_8h.html#a09d41deeced5fca5df9dc680c9e77c38afa8ece0eef17c604369ca69bc4b09970", null ] - ] ] -]; \ No newline at end of file diff --git a/window_8h_source.html b/window_8h_source.html index d530232a..1d98edc1 100644 --- a/window_8h_source.html +++ b/window_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    window.h
    @@ -158,34 +142,30 @@ $(document).ready(function(){initNavTree('window_8h_source.html','');});
    62 } // namespace yage
    63 
    64 #endif
    -
    bool keyPressed(key k)
    Definition: window.cpp:115
    +
    bool keyPressed(key k)
    Definition: window.cpp:111
    Definition: window.h:24
    -
    void swapBuffer()
    swap the buffer
    Definition: window.cpp:83
    -
    void hide()
    hide windowProc
    Definition: window.cpp:95
    +
    void swapBuffer()
    swap the buffer
    Definition: window.cpp:75
    +
    void hide()
    hide windowProc
    Definition: window.cpp:91
    Definition: window.h:30
    -
    bool shouldClose()
    Definition: window.cpp:105
    +
    bool shouldClose()
    Definition: window.cpp:101
    Definition: window.h:25
    WindowFlags
    Definition: window.h:22
    -
    ~Window()
    destroys the window handle
    Definition: window.cpp:38
    -
    void show()
    show window
    Definition: window.cpp:100
    +
    ~Window()
    destroys the window handle
    Definition: window.cpp:39
    +
    void show()
    show window
    Definition: window.cpp:96
    void create(std::string window_name, int width, int height)
    create the window, initialize the handle and update the width and height
    Definition: window.cpp:44
    Definition: window.h:23
    key
    Definition: input.h:18
    -
    void clearBuffer()
    clear buffer
    Definition: window.cpp:89
    -
    void pollEvents() const
    Definition: window.cpp:110
    +
    void clearBuffer()
    clear buffer
    Definition: window.cpp:81
    +
    void pollEvents() const
    Definition: window.cpp:106
    Window & operator=(const Window &)=delete
    Definition: window.h:26
    - - + diff --git a/yage.png b/yage.png new file mode 100644 index 00000000..8b779433 Binary files /dev/null and b/yage.png differ diff --git a/yage_2physics_2README_8md.html b/yage_2physics_2README_8md.html index c2e5fa9f..6dba83e9 100644 --- a/yage_2physics_2README_8md.html +++ b/yage_2physics_2README_8md.html @@ -8,13 +8,6 @@ - - - - -
    +
    yage/physics/README.md File Reference
    - - + diff --git a/yage_8cpp.html b/yage_8cpp.html index a1b01ab6..a3672df2 100644 --- a/yage_8cpp.html +++ b/yage_8cpp.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces | @@ -123,18 +107,18 @@ $(document).ready(function(){initNavTree('yage_8cpp.html','');});
    - +

    @@ -145,15 +129,11 @@ Enumerations

    Namespaces

     yage
     Project namespace.
     Core includes.
     
    - - + + - + - +

    Functions

    void yage::glfwErrorCallback (int, const char *description)
     
    void yage::glfwErrorCallback (int, const char *)
     
    void yage::init ()
     Initializes yage. More...
     Initializes YAGE. More...
     
    void yage::quit ()
     Quit and cleanup yage. More...
     Quit and cleanup YAGE. More...
     

    Detailed Description

    @@ -142,15 +126,11 @@ Functions

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/yage_8cpp.js b/yage_8cpp.js deleted file mode 100644 index dca243b2..00000000 --- a/yage_8cpp.js +++ /dev/null @@ -1,6 +0,0 @@ -var yage_8cpp = -[ - [ "glfwErrorCallback", "yage_8cpp.html#a0bd2fedcbe862fdea1ea54b6b7d49bec", null ], - [ "init", "yage_8cpp.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce", null ], - [ "quit", "yage_8cpp.html#ac9d8c7327204686b3c86f4ab48672618", null ] -]; \ No newline at end of file diff --git a/yage_8h.html b/yage_8h.html index 8a17a9b7..a8a27d20 100644 --- a/yage_8h.html +++ b/yage_8h.html @@ -8,13 +8,6 @@ - - - - -
    + +
    Namespaces | @@ -129,27 +113,28 @@ $(document).ready(function(){initNavTree('yage_8h.html','');}); #include "physics/particlebody.h"
    #include "physics/rectanglecollider.h"
    #include "physics/rigidbody.h"
    +#include "render/drawable.h"
    #include "render/shader.h"
    #include "render/spritebatch.h"
    -#include "render/drawable.h"
    +#include "engine/engine.h"

    Go to the source code of this file.

    - +

    Namespaces

     yage
     Project namespace.
     Core includes.
     
    - - + + - + - +

    Functions

    void yage::glfwErrorCallback (int, const char *description)
     
    void yage::glfwErrorCallback (int, const char *)
     
    void yage::init ()
     Initializes yage. More...
     Initializes YAGE. More...
     
    void yage::quit ()
     Quit and cleanup yage. More...
     Quit and cleanup YAGE. More...
     

    Detailed Description

    @@ -157,15 +142,11 @@ Functions

    Copyright (c) 2017 Yann Herklotz Grave ymher.nosp@m.klot.nosp@m.z@gma.nosp@m.il.c.nosp@m.om

    MIT License, see LICENSE file for more details.

    - - + diff --git a/yage_8h.js b/yage_8h.js deleted file mode 100644 index c91755ba..00000000 --- a/yage_8h.js +++ /dev/null @@ -1,6 +0,0 @@ -var yage_8h = -[ - [ "glfwErrorCallback", "yage_8h.html#a0bd2fedcbe862fdea1ea54b6b7d49bec", null ], - [ "init", "yage_8h.html#a4fc8b4d2a19d4c7f7f1bd42a788827ce", null ], - [ "quit", "yage_8h.html#ac9d8c7327204686b3c86f4ab48672618", null ] -]; \ No newline at end of file diff --git a/yage_8h_source.html b/yage_8h_source.html index d30ba98b..774e8c48 100644 --- a/yage_8h_source.html +++ b/yage_8h_source.html @@ -8,13 +8,6 @@ - - - - -
    + +
    yage.h
    @@ -112,50 +96,57 @@ $(document).ready(function(){initNavTree('yage_8h_source.html','');});
    9 #ifndef YAGE_YAGE_H
    10 #define YAGE_YAGE_H
    11 
    -
    12 #include "core/camera.h"
    -
    13 #include "core/iomanager.h"
    -
    14 #include "core/logger.h"
    -
    15 #include "core/resourcemanager.h"
    -
    16 #include "core/spritesheet.h"
    -
    17 #include "core/window.h"
    -
    18 #include "data/input.h"
    -
    19 #include "data/texture.h"
    -
    20 #include "data/vertex.h"
    -
    21 #include "math/matrix.h"
    -
    22 #include "physics/body.h"
    -
    23 #include "physics/particlebody.h"
    - -
    25 #include "physics/rigidbody.h"
    -
    26 #include "render/shader.h"
    -
    27 #include "render/spritebatch.h"
    -
    28 #include "render/drawable.h"
    -
    29 
    -
    35 namespace yage
    -
    36 {
    -
    37 
    -
    38 extern void glfwErrorCallback(int, const char *);
    -
    39 
    -
    46 extern void init();
    -
    47 
    -
    52 extern void quit();
    -
    53 
    -
    54 } // namespace yage
    -
    55 
    -
    56 #endif
    +
    15 #include "core/camera.h"
    +
    16 #include "core/iomanager.h"
    +
    17 #include "core/logger.h"
    +
    18 #include "core/resourcemanager.h"
    +
    19 #include "core/spritesheet.h"
    +
    20 #include "core/window.h"
    +
    21 
    +
    25 #include "data/input.h"
    +
    26 #include "data/texture.h"
    +
    27 #include "data/vertex.h"
    +
    28 
    +
    32 #include "math/matrix.h"
    +
    33 
    +
    37 #include "physics/body.h"
    +
    38 #include "physics/particlebody.h"
    + +
    40 #include "physics/rigidbody.h"
    +
    41 
    +
    45 #include "render/drawable.h"
    +
    46 #include "render/shader.h"
    +
    47 #include "render/spritebatch.h"
    +
    48 
    +
    53 #include "engine/engine.h"
    +
    54 
    +
    60 namespace yage
    +
    61 {
    +
    62 
    +
    66 extern void glfwErrorCallback(int, const char *);
    +
    67 
    +
    74 extern void init();
    +
    75 
    +
    81 extern void quit();
    +
    82 
    +
    83 } // namespace yage
    +
    84 
    +
    85 #endif
    -
    void quit()
    Quit and cleanup yage.
    Definition: yage.cpp:32
    +
    void quit()
    Quit and cleanup YAGE.
    Definition: yage.cpp:32
    + -
    void init()
    Initializes yage.
    Definition: yage.cpp:24
    +
    void init()
    Initializes YAGE.
    Definition: yage.cpp:24
    -
    void glfwErrorCallback(int, const char *description)
    Definition: yage.cpp:19
    - + +
    void glfwErrorCallback(int, const char *description)
    Definition: yage.cpp:19
    @@ -163,15 +154,11 @@ $(document).ready(function(){initNavTree('yage_8h_source.html','');});
    - - + -- cgit