{"id":2942,"date":"2022-01-28T16:47:56","date_gmt":"2022-01-28T16:47:56","guid":{"rendered":"https:\/\/castle-engine.io\/wp\/?p=2942"},"modified":"2022-01-28T16:47:56","modified_gmt":"2022-01-28T16:47:56","slug":"more-integration-with-vampyre-imaging-library-used-by-default-with-both-fpc-and-delphi","status":"publish","type":"post","link":"https:\/\/castle-engine.io\/wp\/2022\/01\/28\/more-integration-with-vampyre-imaging-library-used-by-default-with-both-fpc-and-delphi\/","title":{"rendered":"More integration with Vampyre Imaging Library, used by default with both FPC and Delphi"},"content":{"rendered":"<table class=\"thumbnails thumbnails-align-right\"><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-17-35-39.png\"\n             class=\"screenshot\"\n             title=\"Castle Game Engine editor with 3D level\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-17-35-39-200x113.png\"\n             width=\"200\" height=\"113\" \n            alt=\"Castle Game Engine editor with 3D level\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-16-33-24.png\"\n             class=\"screenshot\"\n             title=\"Castle Game Engine Lazarus packages\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-16-33-24-200x256.png\"\n             width=\"200\" height=\"256\" \n            alt=\"Castle Game Engine Lazarus packages\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-16-36-29.png\"\n             class=\"screenshot\"\n             title=\"Castle Game Engine images demo\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-16-36-29-200x118.png\"\n             width=\"200\" height=\"118\" \n            alt=\"Castle Game Engine images demo\"\n          ><\/a><\/td><\/tr><\/table>\n<p>We&#8217;re moving further with <a href=\"https:\/\/imaginglib.sourceforge.io\/\">Vampyre Imaging Library<\/a> integration, to have more features related to image loading and at the same time less code to maintain in <i>Castle Game Engine<\/i>.<\/p>\n<ol>\n<li>\n<p>We now use Vampyre always, by default, with both FPC and Delphi. This makes our code simpler and more consistent.<\/p>\n<p>Note: our <code>castle_base.lpk<\/code> depends on Vampyre Lazarus packages, to use Vampyre packages in a clean (Lazarus) way, using all compilation configuration done by Vampyre authors. This is important if you compile using Lazarus (though project LPI file, that in turn uses LPK packages).<\/p>\n<p>After updating to latest CGE, be sure to use <i>&#8220;Preferences -&gt; FPC and Lazarus -&gt; Register Lazarus Packages&#8221;<\/i> in CGE editor,or just open in Lazarus and compile these 2 packages:<\/p>\n<pre>\nsrc\/vampyre_imaginglib\/src\/Packages\/VampyreImaginePackage.lpk\nsrc\/vampyre_imaginglib\/src\/Packages\/VampyreImaginePackageExt.lpk\n<\/pre>\n<p>This doesn&#8217;t matter if you compile using Delphi, or using CGE build tool that executes FPC directly (passing paths to CGE and Vampyre, without relying on Lazarus LPI\/LPK information).<\/p>\n<li>\n<p>We now rely on Vampyre for loading and saving of BMP, PPM and RGBE image formats. <\/p>\n<p>I completely removed the old code for handling these image formats (without Vampyre) in CGE. This means less code in CGE which makes me happy \ud83d\ude42 Moreover, Vampyre brings some extra features: handles RLE-compressed BMP files, can save RGBE files with compression.<\/p>\n<li>\n<p>We synchronized with <a href=\"https:\/\/github.com\/galfar\/imaginglib\">latest Vampyre Imaging Library code<\/a>, and reenabled JP2 and TIFF saving using Vampyre. We check <code>TSingleImage.SaveToStream<\/code> to know if it&#8217;s successful.<\/p>\n<li>\n<p>For now, you can still disable Vampyre usage, by removing <code>{$define USE_VAMPYRE_IMAGING}<\/code> from our <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/blob\/master\/src\/common_includes\/castleconf.inc\">src\/common_includes\/castleconf.inc<\/a>. <\/p>\n<p>If you have a good reason to do this (disable Vampyre), please <a href=\"https:\/\/castle-engine.io\/talk.php\">tell us (on forum or Discord)<\/a> &mdash; we want to know about it. In the future, Vampyre may be just non-optional dependency of CGE, and we&#8217;ll integrate more and just use Vampyre as our image container in memory (right now we copy data between Vampyre and CGE <code><a href=\"https:\/\/castle-engine.io\/apidoc\/html\/CastleImages.TCastleImage.html\">TCastleImage<\/a><\/code>, <code><a href=\"https:\/\/castle-engine.io\/apidoc\/html\/CastleImages.TGPUCompressedImage.html\">TGPUCompressedImage<\/a><\/code>, instead of referencing it).\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re moving further with Vampyre Imaging Library integration, to have more features related to image loading and at the same time less code to maintain in Castle Game Engine. We now use Vampyre always, by default, with both FPC and Delphi. This makes our code simpler and more consistent. Note: our castle_base.lpk depends on Vampyre &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/castle-engine.io\/wp\/2022\/01\/28\/more-integration-with-vampyre-imaging-library-used-by-default-with-both-fpc-and-delphi\/\" class=\"more-link\">Continue reading  \u27a4<span class=\"screen-reader-text\"> &#8220;More integration with Vampyre Imaging Library, used by default with both FPC and Delphi&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2947,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"1","publish_post_category":"9","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"1730","discourse_permalink":"https:\/\/forum.castle-engine.io\/t\/more-integration-with-vampyre-imaging-library-used-by-default-with-both-fpc-and-delphi\/509","wpdc_publishing_response":"","wpdc_publishing_error":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-2942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2022\/01\/Zrzut-ekranu-z-2022-01-28-17-35-39.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9IgYW-Ls","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/2942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/comments?post=2942"}],"version-history":[{"count":6,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/2942\/revisions"}],"predecessor-version":[{"id":2952,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/2942\/revisions\/2952"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media\/2947"}],"wp:attachment":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media?parent=2942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/categories?post=2942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/tags?post=2942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}