{"id":13742596,"url":"https://github.com/orgicus/PBGUI","last_synced_at":"2025-05-09T00:31:30.057Z","repository":{"id":1180927,"uuid":"1080156","full_name":"orgicus/PBGUI","owner":"orgicus","description":"A Minimal Components GUI for Pixel Bender shaders","archived":false,"fork":false,"pushed_at":"2010-11-20T21:22:32.000Z","size":2760,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T23:48:01.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orgicus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-15T02:17:48.000Z","updated_at":"2019-03-12T17:51:44.000Z","dependencies_parsed_at":"2022-08-16T12:25:32.609Z","dependency_job_id":null,"html_url":"https://github.com/orgicus/PBGUI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orgicus%2FPBGUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orgicus%2FPBGUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orgicus%2FPBGUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orgicus%2FPBGUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orgicus","download_url":"https://codeload.github.com/orgicus/PBGUI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253170944,"owners_count":21865273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:00:33.945Z","updated_at":"2025-05-09T00:31:29.378Z","avatar_url":"https://github.com/orgicus.png","language":"ActionScript","readme":"PBGUI\n========\n\n#### A Minimal Components GUI for Pixel Bender shaders ####\n\nPixel Bender shaders can be used in Photoshop, After Effects and Flash Player.\nWhile Photoshop and After Effects provides a GUI, there are no helper GUI classes\nfor actionscript.\n\nPBGUI generates a simple interface using \u003ca href=\"http://minimalcomps.com/\"\u003eKeith Peters' Minimal Comps\u003c/a\u003e.\n\nMost of the sample images ship with Pixel Bender by default.\nFor more Pixel Bender shaders checkout the \u003ca href=\"http://www.adobe.com/cfusion/exchange/index.cfm?event=productHome\u0026exc=26\"\u003ePixel Bender Exchange\u003c/a\u003e\n\n[More info...](http://disturbmedia.com/blog/post/pbgui-a-minimal-actionscript-ui-for-pixel-bender-shaders/)\n\n\n### Example: ###\n\n[![PBGUI](https://github.com/orgicus/PBGUI/raw/master/bin/pbgui.gif)](http://orgicus.github.com/PBGUI/bin/pbgui.html)\n\n### Usage ###\n\nWhile the PBGUI class provides a basic example of Pixel Bender parameters + a means to load shaders and images\nfor preview, the aim is to provide a simple class that draws a GUI and handles input for shaders.\nThis is achieved using the ShaderControls class:\n\n\t//shader is a reference to an initialized Shader instance\n\tvar controls:ShaderControls = new ShaderControls(shader);\n\taddChild(controls);\n\t//changes are handled through callbacks\n\tcontrols.onToggle = onToggle;\n\tcontrols.onUpdate = onUpdate;\n\tcontrols.onReset = onReset;\n\t\n\t//name = shader parameter name and value is the array of values for the updated parameter\n\t//preview = a DisplayObject used for previewing/applying the filters\n\tfunction onUpdate(name : String, value : Array) : void {\n\t\tshader.data[name].value = value;\n\t\tpreview.loader.filters = [shaderFilter];\n\t}\n\tfunction onReset():void{\n\t\tpreview.loader.filters = [shaderFilter];\t\n\t}\n\tfunction onToggle(on:Boolean):void{\n\t\tpreview.loader.filters = on ? [shaderFilter]:[];\t\n\t}\n\t\nHere is an expanded \u003ca href=\"https://github.com/orgicus/PBGUI/blob/master/src/com/disturbmedia/pb/Example.as\"\u003eexample\u003c/a\u003e :\t\n\n\tpackage {\n\t\timport com.disturbmedia.pb.utils.ShaderControls;\n\n\t\timport flash.display.DisplayObject;\n\t\timport flash.display.Shader;\n\t\timport flash.display.Sprite;\n\t\timport flash.filters.ShaderFilter;\n\n\t\t/**\n\t\t * @author George Profenza\n\t\t * \n\t\t * This example shows how you would the ShaderControls in a project.\n\t\t * PBGUI.as is there to easily load assets, kernels and test them, outsite your project\n\t\t * \n\t\t * The goal of this project is to generate a GUI for your PixelBender shaders\n\t\t * that you can hook up to your project. This is achieved through the ShaderControls class and it's callbacks\n\t\t * \n\t\t * ShaderControls draws a draggable window which can be minimized so you can view your project easily\n\t\t * Maximize the window when you want to use the shader controls\n\t\t */\n\t\tpublic class Example extends Sprite {\n\n\t\t\t[Embed(source=\"../bin/assets/kernels/Bloom.pbj\", mimeType=\"application/octet-stream\")]  \n\t\t\tprivate var ShaderClass : Class;\n\t\t\tprivate var shader:Shader;\n\t\t\tprivate var shaderFilter:ShaderFilter;\n\n\t\t\t[Embed(source=\"../bin/assets/images/Canyonlands.png\")]\n\t\t\tprivate var ImageClass:Class;\t\t\n\t\t\tprivate var preview:DisplayObject;\n\t\t\tprivate var controls:ShaderControls;\n\n\t\t\tpublic function Example() {\n\t\t\t\tinit();\n\t\t\t}\n\n\t\t\tprivate function init() : void {\n\t\t\t\tpreview = new ImageClass();\n\t\t\t\taddChild(preview);//add some content you want to preview the filter on\n\n\t\t\t\t//intialize the filter\n\t\t\t\tshader = new Shader(new ShaderClass());\n\t\t\t\tshaderFilter = new ShaderFilter(shader);\n\n\t\t\t\t//intialize the controls\n\t\t\t\tcontrols = new ShaderControls(shader);\n\t\t\t\tcontrols.onUpdate = updateFilter;\n\t\t\t\tcontrols.onToggle = toggleFilter;\n\t\t\t\tcontrols.onReset = applyFilter;\n\t\t\t\taddChild(controls);\t\n\t\t\t}\n\t\t\t//update the shader and re-apply the filter. The callback returns the name of the changed parameter and the values array\n\t\t\tprivate function updateFilter(name : String, value : Array) : void {\n\t\t\t\tshader.data[name].value = value;\n\t\t\t\tpreview.filters = [shaderFilter];\n\t\t\t}\n\t\t\t//This is called when the \"activated\" checkbox is toggled\n\t\t\tprivate function toggleFilter(on:Boolean) : void {\n\t\t\t\tpreview.filters = on ? [shaderFilter] : [];\n\t\t\t}\n\t\t\t//This is called when the \"Reset to Defaults\" button is pressed\n\t\t\tprivate function applyFilter() : void {\n\t\t\t\tpreview.filters = [shaderFilter];\n\t\t\t}\n\t\t}\n\t}\n\n### Notes ###\n\nNot all controls have been thoroughly tested, so watch out, here be bugs!\nIn case you run into any, plase provide details on the \u003ca href=\"https://github.com/orgicus/PBGUI/issues\"\u003eIssues\u003c/a\u003e page.\n\n### Changes ###\n\n* tested controls - added VarTest kernel to test parameters\n* added ControlsContainer - if your filter has A LOT of parameters, you can set a maximum height for the controls area(default is 180)\nanything larger is accessed through scrolling. Use browse filter and VarTest.pbj to see this.","funding_links":[],"categories":["User Interface"],"sub_categories":["UI Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forgicus%2FPBGUI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forgicus%2FPBGUI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forgicus%2FPBGUI/lists"}