{"id":22782991,"url":"https://github.com/shimeoki/jfx-rasterization","last_synced_at":"2025-04-15T18:26:14.242Z","repository":{"id":260156948,"uuid":"873641295","full_name":"shimeoki/jfx-rasterization","owner":"shimeoki","description":"A JavaFX shape rasterization library.","archived":false,"fork":false,"pushed_at":"2025-01-01T15:59:40.000Z","size":597,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:33:07.748Z","etag":null,"topics":["java","javafx","jfx","rasterization"],"latest_commit_sha":null,"homepage":"https://shimeoki.github.io/jfx-rasterization/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shimeoki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-16T14:00:30.000Z","updated_at":"2025-01-01T15:59:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"421fdf40-78ec-49a4-b7a8-b3065f11838b","html_url":"https://github.com/shimeoki/jfx-rasterization","commit_stats":null,"previous_names":["shimeoki/jfx-rasterization"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimeoki%2Fjfx-rasterization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimeoki%2Fjfx-rasterization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimeoki%2Fjfx-rasterization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimeoki%2Fjfx-rasterization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shimeoki","download_url":"https://codeload.github.com/shimeoki/jfx-rasterization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249127693,"owners_count":21217021,"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":["java","javafx","jfx","rasterization"],"created_at":"2024-12-11T22:06:16.456Z","updated_at":"2025-04-15T18:26:14.212Z","avatar_url":"https://github.com/shimeoki.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jfx-rasterization\n\nA JavaFX shape rasterization library.\n\nThis repository contains two projects: the library itself and the \"demo\" app.\n\nMain focus is the library project, which is located in the `lib` directory. It's referred just as `jfx-rasterization` from now on.\n\n## Prerequisites\n\n- JDK 21+\n\nThe Java version probably can be downgraded, but it's not recommended. Everything was tested on JDK 21.\n\nThe library depends on `javafx-graphics` module as an API (the consumer also needs to use this module), but the library will download it automatically.\n\n## Download\n\nFirst of all, you need to get the repository itself.\n\nYou can download it from the GitHub using the \"Code\" button (and \"Download ZIP\" afterwards) or just clone the repository, if you have `git` installed:\n\n```sh\ngit clone https://github.com/shimeoki/jfx-rasterization\n```\n\nAfter downloading (and unzipping in the first case) the repository, go into the root directory of the project. If you have used the `git clone` command, you can do that with:\n\n```sh\ncd jfx-rasterization\n```\n\n## Build\n\nAs of version 1.0.0, the library supports only building (and publishing) locally.\n\nIf you don't want to build, some versions of the library can be found at the \"Releases\" page.\n\nBuild is platform independent, except for the Gradle wrapper. From now on, `gw` is the alias for correct Gradle wrapper command for the platform.\n\nLinux and MacOS:\n\n```sh\n./gradlew\n```\n\nWindows:\n\n```powershell\n.\\gradlew.bat\n```\n\nThe wrapper is located in the root directory, so all the commands should be done from here.\n\n### Runtime JAR\n\nIf you just want to get the runtime JAR file (no Javadoc and source files), you can do the following:\n\n```sh\ngw :lib:jar\n```\n\nThe JAR file is located at `lib/build/libs`.\n\n### All JARs\n\nIf you want to get all the JARs (runtime, Javadoc and source files), use the command:\n\n```sh\ngw :lib:build\n```\n\nAll three JARs are located at `lib/build/libs`.\n\n### Distributed archive\n\nIf you want to get the runtime JAR and the dependencies (JavaFX), you can use:\n\n```sh\ngw :lib:distZip\n```\n\nAfter this command, the ZIP file is created at `lib/build/distribution`.\n\nAlso, the ZIP is generated after the `build` command, alongside with the TAR archive.\n\n### Maven artifact\n\nThere is an option to get the library as a Maven artifact to the local repository (`.m2` directory in the home directory):\n\n```sh\ngw :lib:publishToMavenLocal\n```\n\nThe artifact includes all the JARs.\n\n## Import\n\nDepending on the IDE or build tool you are using and the way of the build, the process of import can vary.\n\nI, personally, don't use Maven or any IDE, so the following applies only for Gradle. Additions to this section (and any other) are welcomed.\n\n### Gradle\n\nThe examples are given with the Kotlin DSL. If the DSL is Groovy, syntax would be different, but semantically it's the same.\n\nAlso, in the `dependencies` section, `implementation()` is used, but it can be an `api()` function, based on the use case.\n\n#### Maven artifact\n\nThe recommended way is the Maven artifact. It includes all the JARs, so Javadocs are included for the usage with the LSPs. Also, it's the easiest and most convenient approach.\n\nAfter building the artifact and publishing it to the local repository, add the following to the `build.gradle.kts`:\n\n```kts\nrepositories {\n    // other repositories\n\n    mavenLocal()\n}\n\ndependencies {\n    // other dependencies\n\n    implementation(\"com.github.shimeoki:jfx-rasterization:1.0.0\")\n    // instead of 1.0.0 specify the built version\n    // or any version in the local maven repository\n}\n```\n\n#### Local JAR\n\nIf you don't need the Javadocs or don't want to use the Maven artifact variant, you can just import the runtime JAR file.\n\nAfter the build, copy (cut) the JAR to your project. For example, to `libs` directory in the root.\n\nAdd to the `build.gradle.kts`:\n\n```kts\ndependencies {\n    // other dependencies\n\n    implementation(file(\"../libs/jfx-rasterization-1.0.0.jar\"))\n    // instead of 1.0.0 specify the built version (written in the filename)\n}\n```\nAs the path, valid relative path to the JAR with the respect to `build.gradle.kts` file should be specified.\n\nInstead of the `file()` call, `files()` can be used. \n\nAlso, with this approach you can import other JAR files, like the JavaFX from the distributed archive.\n\n## Usage\n\nA couple of examples are listed in the Javadocs. However, as of version 1.0.0, the main usage for the library is the triangle rasterization feature.\n\nMost important classes for the user can be found in the `triangle` package. It's the `Triangler` interface and a couple of implementations for the interface.\n\nExample usage can be seen in the `demo` project's source code. Also, the following example is included in the Javadoc:\n\n```java\n// any implementations can be used, look at the interfaces\n\nfinal Triangler triangler = new DDATriangler();\nfinal Canvas canvas; // javafx canvas to render on\n\nfinal GraphicsContext ctx = canvas.getGraphicsContext2D();\nfinal Triangle triangle = new StaticTriangle(\n        new Point2f(0, 1),\n        new Point2f(1, 0),\n        new Point2f(1, 1));\nfinal TriangleColorer colorer = new StaticMonotoneTriangleColorer();\n\ntriangler.draw(ctx, triangle, colorer);\n```\n\n## demo\n\nThis project is intended for internal testing. However, it can be used as a showcase tool.\n\nIt has 3 modes:\n\n- Static - grid of tiles with random triangles;\n- Dynamic - canvas with the \"DVD logo\" moving vertices for the triangles;\n- Interactive - triangles are drawn after 3 clicks on the canvas.\n\nThe project is in very early development stage, but if you want to check it out, you can use the following command:\n\n```sh\ngw :demo:run\n```\n\n## Javadoc\n\nJavadoc can be viewed as a separate website.\n\nAfter the corresponding JAR build, unpack the JAR to any directory and open the `index.html` file with your browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimeoki%2Fjfx-rasterization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimeoki%2Fjfx-rasterization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimeoki%2Fjfx-rasterization/lists"}