2024-10-04 16:16:47 -04:00
|
|
|
[package]
|
|
|
|
name = "bevy_image"
|
2025-01-06 00:04:44 +00:00
|
|
|
version = "0.16.0-dev"
|
2024-10-04 16:16:47 -04:00
|
|
|
edition = "2021"
|
|
|
|
description = "Provides image types for Bevy Engine"
|
|
|
|
homepage = "https://bevyengine.org"
|
|
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
|
|
license = "MIT OR Apache-2.0"
|
|
|
|
keywords = ["bevy"]
|
|
|
|
|
|
|
|
[features]
|
2025-01-11 17:24:34 -08:00
|
|
|
default = ["bevy_reflect"]
|
|
|
|
|
|
|
|
bevy_reflect = ["dep:bevy_reflect", "bevy_math/bevy_reflect"]
|
|
|
|
|
Feature-gate all image formats (#15586)
# Objective
Bevy supports feature gates for each format it supports, but several
formats that it loads via the `image` crate do not have feature gates.
Additionally, the QOI format is supported by the `image` crate and
wasn't available at all. This fixes that.
## Solution
The following feature gates are added:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `qoi`
* `tiff`
None of these formats are enabled by default, despite the fact that all
these formats appeared to be enabled by default before. Since
`default-features` was disabled for the `image` crate, it's likely that
using any of these formats would have errored by default before this
change, although this probably needs additional testing.
## Testing
The changes seemed minimal enough that a compile test would be
sufficient.
## Migration guide
Image formats that previously weren't feature-gated are now
feature-gated, meaning they will have to be enabled if you use them:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `tiff`
Additionally, the `qoi` feature has been added to support loading QOI
format images.
Previously, these formats appeared in the enum by default, but weren't
actually enabled via the `image` crate, potentially resulting in weird
bugs. Now, you should be able to add these features to your projects to
support them properly.
2024-10-07 12:37:45 -04:00
|
|
|
# Image formats
|
|
|
|
basis-universal = ["dep:basis-universal"]
|
|
|
|
bmp = ["image/bmp"]
|
|
|
|
dds = ["ddsfile"]
|
2024-10-04 16:16:47 -04:00
|
|
|
exr = ["image/exr"]
|
Feature-gate all image formats (#15586)
# Objective
Bevy supports feature gates for each format it supports, but several
formats that it loads via the `image` crate do not have feature gates.
Additionally, the QOI format is supported by the `image` crate and
wasn't available at all. This fixes that.
## Solution
The following feature gates are added:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `qoi`
* `tiff`
None of these formats are enabled by default, despite the fact that all
these formats appeared to be enabled by default before. Since
`default-features` was disabled for the `image` crate, it's likely that
using any of these formats would have errored by default before this
change, although this probably needs additional testing.
## Testing
The changes seemed minimal enough that a compile test would be
sufficient.
## Migration guide
Image formats that previously weren't feature-gated are now
feature-gated, meaning they will have to be enabled if you use them:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `tiff`
Additionally, the `qoi` feature has been added to support loading QOI
format images.
Previously, these formats appeared in the enum by default, but weren't
actually enabled via the `image` crate, potentially resulting in weird
bugs. Now, you should be able to add these features to your projects to
support them properly.
2024-10-07 12:37:45 -04:00
|
|
|
ff = ["image/ff"]
|
|
|
|
gif = ["image/gif"]
|
2024-10-04 16:16:47 -04:00
|
|
|
hdr = ["image/hdr"]
|
Feature-gate all image formats (#15586)
# Objective
Bevy supports feature gates for each format it supports, but several
formats that it loads via the `image` crate do not have feature gates.
Additionally, the QOI format is supported by the `image` crate and
wasn't available at all. This fixes that.
## Solution
The following feature gates are added:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `qoi`
* `tiff`
None of these formats are enabled by default, despite the fact that all
these formats appeared to be enabled by default before. Since
`default-features` was disabled for the `image` crate, it's likely that
using any of these formats would have errored by default before this
change, although this probably needs additional testing.
## Testing
The changes seemed minimal enough that a compile test would be
sufficient.
## Migration guide
Image formats that previously weren't feature-gated are now
feature-gated, meaning they will have to be enabled if you use them:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `tiff`
Additionally, the `qoi` feature has been added to support loading QOI
format images.
Previously, these formats appeared in the enum by default, but weren't
actually enabled via the `image` crate, potentially resulting in weird
bugs. Now, you should be able to add these features to your projects to
support them properly.
2024-10-07 12:37:45 -04:00
|
|
|
ktx2 = ["dep:ktx2"]
|
|
|
|
ico = ["image/ico"]
|
2024-10-04 16:16:47 -04:00
|
|
|
jpeg = ["image/jpeg"]
|
Feature-gate all image formats (#15586)
# Objective
Bevy supports feature gates for each format it supports, but several
formats that it loads via the `image` crate do not have feature gates.
Additionally, the QOI format is supported by the `image` crate and
wasn't available at all. This fixes that.
## Solution
The following feature gates are added:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `qoi`
* `tiff`
None of these formats are enabled by default, despite the fact that all
these formats appeared to be enabled by default before. Since
`default-features` was disabled for the `image` crate, it's likely that
using any of these formats would have errored by default before this
change, although this probably needs additional testing.
## Testing
The changes seemed minimal enough that a compile test would be
sufficient.
## Migration guide
Image formats that previously weren't feature-gated are now
feature-gated, meaning they will have to be enabled if you use them:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `tiff`
Additionally, the `qoi` feature has been added to support loading QOI
format images.
Previously, these formats appeared in the enum by default, but weren't
actually enabled via the `image` crate, potentially resulting in weird
bugs. Now, you should be able to add these features to your projects to
support them properly.
2024-10-07 12:37:45 -04:00
|
|
|
png = ["image/png"]
|
2024-10-04 16:16:47 -04:00
|
|
|
pnm = ["image/pnm"]
|
Feature-gate all image formats (#15586)
# Objective
Bevy supports feature gates for each format it supports, but several
formats that it loads via the `image` crate do not have feature gates.
Additionally, the QOI format is supported by the `image` crate and
wasn't available at all. This fixes that.
## Solution
The following feature gates are added:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `qoi`
* `tiff`
None of these formats are enabled by default, despite the fact that all
these formats appeared to be enabled by default before. Since
`default-features` was disabled for the `image` crate, it's likely that
using any of these formats would have errored by default before this
change, although this probably needs additional testing.
## Testing
The changes seemed minimal enough that a compile test would be
sufficient.
## Migration guide
Image formats that previously weren't feature-gated are now
feature-gated, meaning they will have to be enabled if you use them:
* `avif`
* `ff` (Farbfeld)
* `gif`
* `ico`
* `tiff`
Additionally, the `qoi` feature has been added to support loading QOI
format images.
Previously, these formats appeared in the enum by default, but weren't
actually enabled via the `image` crate, potentially resulting in weird
bugs. Now, you should be able to add these features to your projects to
support them properly.
2024-10-07 12:37:45 -04:00
|
|
|
qoi = ["image/qoi"]
|
|
|
|
tga = ["image/tga"]
|
|
|
|
tiff = ["image/tiff"]
|
|
|
|
webp = ["image/webp"]
|
2025-01-24 03:46:08 +11:00
|
|
|
serialize = [
|
|
|
|
"bevy_reflect",
|
|
|
|
"bevy_platform_support/serialize",
|
|
|
|
"bevy_utils/serde",
|
|
|
|
]
|
2024-10-04 16:16:47 -04:00
|
|
|
|
|
|
|
# For ktx2 supercompression
|
|
|
|
zlib = ["flate2"]
|
|
|
|
zstd = ["ruzstd"]
|
|
|
|
|
|
|
|
[dependencies]
|
Move `TextureAtlas` and friends into `bevy_image` (#17219)
# Objective
- Allow other crates to use `TextureAtlas` and friends without needing
to depend on `bevy_sprite`.
- Specifically, this allows adding `TextureAtlas` support to custom
cursors in https://github.com/bevyengine/bevy/pull/17121 by allowing
`bevy_winit` to depend on `bevy_image` instead of `bevy_sprite` which is
a [non-starter].
[non-starter]:
https://github.com/bevyengine/bevy/pull/17121#discussion_r1904955083
## Solution
- Move `TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder` into `bevy_image`.
- Add a new plugin to `bevy_image` named `TextureAtlasPlugin` which
allows us to register `TextureAtlas` and `TextureAtlasLayout` which was
previously done in `SpritePlugin`. Since `SpritePlugin` did the
registration previously, we just need to make it add
`TextureAtlasPlugin`.
## Testing
- CI builds it.
- I also ran multiple examples which hopefully covered any issues:
```
$ cargo run --example sprite
$ cargo run --example text
$ cargo run --example ui_texture_atlas
$ cargo run --example sprite_animation
$ cargo run --example sprite_sheet
$ cargo run --example sprite_picking
```
---
## Migration Guide
The following types have been moved from `bevy_sprite` to `bevy_image`:
`TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder`.
If you are using the `bevy` crate, and were importing these types
directly (e.g. before `use bevy::sprite::TextureAtlas`), be sure to
update your import paths (e.g. after `use bevy::image::TextureAtlas`)
If you are using the `bevy` prelude to import these types (e.g. `use
bevy::prelude::*`), you don't need to change anything.
If you are using the `bevy_sprite` subcrate, be sure to add `bevy_image`
as a dependency if you do not already have it, and be sure to update
your import paths.
2025-01-08 05:43:11 +11:00
|
|
|
# bevy
|
|
|
|
bevy_app = { path = "../bevy_app", version = "0.16.0-dev" }
|
2025-01-06 00:04:44 +00:00
|
|
|
bevy_asset = { path = "../bevy_asset", version = "0.16.0-dev" }
|
|
|
|
bevy_color = { path = "../bevy_color", version = "0.16.0-dev", features = [
|
2024-10-04 16:16:47 -04:00
|
|
|
"serialize",
|
|
|
|
"wgpu-types",
|
|
|
|
] }
|
2025-01-11 17:24:34 -08:00
|
|
|
bevy_math = { path = "../bevy_math", version = "0.16.0-dev" }
|
2025-01-06 00:04:44 +00:00
|
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", features = [
|
2024-10-04 16:16:47 -04:00
|
|
|
"bevy",
|
2025-01-11 17:24:34 -08:00
|
|
|
], optional = true }
|
2025-01-06 00:04:44 +00:00
|
|
|
bevy_utils = { path = "../bevy_utils", version = "0.16.0-dev" }
|
2025-01-24 03:46:08 +11:00
|
|
|
bevy_platform_support = { path = "../bevy_platform_support", version = "0.16.0-dev", default-features = false, features = [
|
|
|
|
"std",
|
|
|
|
] }
|
2024-10-04 16:16:47 -04:00
|
|
|
|
|
|
|
# rendering
|
|
|
|
image = { version = "0.25.2", default-features = false }
|
|
|
|
|
|
|
|
# misc
|
|
|
|
bitflags = { version = "2.3", features = ["serde"] }
|
|
|
|
bytemuck = { version = "1.5" }
|
2025-02-09 11:40:53 -08:00
|
|
|
wgpu-types = { version = "24", default-features = false }
|
2024-10-04 16:16:47 -04:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
2024-12-07 04:03:55 +11:00
|
|
|
thiserror = { version = "2", default-features = false }
|
2024-10-04 16:16:47 -04:00
|
|
|
futures-lite = "2.0.1"
|
Move `TextureAtlas` and friends into `bevy_image` (#17219)
# Objective
- Allow other crates to use `TextureAtlas` and friends without needing
to depend on `bevy_sprite`.
- Specifically, this allows adding `TextureAtlas` support to custom
cursors in https://github.com/bevyengine/bevy/pull/17121 by allowing
`bevy_winit` to depend on `bevy_image` instead of `bevy_sprite` which is
a [non-starter].
[non-starter]:
https://github.com/bevyengine/bevy/pull/17121#discussion_r1904955083
## Solution
- Move `TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder` into `bevy_image`.
- Add a new plugin to `bevy_image` named `TextureAtlasPlugin` which
allows us to register `TextureAtlas` and `TextureAtlasLayout` which was
previously done in `SpritePlugin`. Since `SpritePlugin` did the
registration previously, we just need to make it add
`TextureAtlasPlugin`.
## Testing
- CI builds it.
- I also ran multiple examples which hopefully covered any issues:
```
$ cargo run --example sprite
$ cargo run --example text
$ cargo run --example ui_texture_atlas
$ cargo run --example sprite_animation
$ cargo run --example sprite_sheet
$ cargo run --example sprite_picking
```
---
## Migration Guide
The following types have been moved from `bevy_sprite` to `bevy_image`:
`TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder`.
If you are using the `bevy` crate, and were importing these types
directly (e.g. before `use bevy::sprite::TextureAtlas`), be sure to
update your import paths (e.g. after `use bevy::image::TextureAtlas`)
If you are using the `bevy` prelude to import these types (e.g. `use
bevy::prelude::*`), you don't need to change anything.
If you are using the `bevy_sprite` subcrate, be sure to add `bevy_image`
as a dependency if you do not already have it, and be sure to update
your import paths.
2025-01-08 05:43:11 +11:00
|
|
|
guillotiere = "0.6.0"
|
|
|
|
rectangle-pack = "0.4"
|
2024-10-04 16:16:47 -04:00
|
|
|
ddsfile = { version = "0.5.2", optional = true }
|
|
|
|
ktx2 = { version = "0.3.0", optional = true }
|
|
|
|
# For ktx2 supercompression
|
|
|
|
flate2 = { version = "1.0.22", optional = true }
|
|
|
|
ruzstd = { version = "0.7.0", optional = true }
|
|
|
|
# For transcoding of UASTC/ETC1S universal formats, and for .basis file support
|
|
|
|
basis-universal = { version = "0.3.0", optional = true }
|
2025-01-06 10:06:34 +11:00
|
|
|
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
2025-01-31 01:36:11 +01:00
|
|
|
half = { version = "2.4.1" }
|
2024-10-04 16:16:47 -04:00
|
|
|
|
Move `TextureAtlas` and friends into `bevy_image` (#17219)
# Objective
- Allow other crates to use `TextureAtlas` and friends without needing
to depend on `bevy_sprite`.
- Specifically, this allows adding `TextureAtlas` support to custom
cursors in https://github.com/bevyengine/bevy/pull/17121 by allowing
`bevy_winit` to depend on `bevy_image` instead of `bevy_sprite` which is
a [non-starter].
[non-starter]:
https://github.com/bevyengine/bevy/pull/17121#discussion_r1904955083
## Solution
- Move `TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder` into `bevy_image`.
- Add a new plugin to `bevy_image` named `TextureAtlasPlugin` which
allows us to register `TextureAtlas` and `TextureAtlasLayout` which was
previously done in `SpritePlugin`. Since `SpritePlugin` did the
registration previously, we just need to make it add
`TextureAtlasPlugin`.
## Testing
- CI builds it.
- I also ran multiple examples which hopefully covered any issues:
```
$ cargo run --example sprite
$ cargo run --example text
$ cargo run --example ui_texture_atlas
$ cargo run --example sprite_animation
$ cargo run --example sprite_sheet
$ cargo run --example sprite_picking
```
---
## Migration Guide
The following types have been moved from `bevy_sprite` to `bevy_image`:
`TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder`.
If you are using the `bevy` crate, and were importing these types
directly (e.g. before `use bevy::sprite::TextureAtlas`), be sure to
update your import paths (e.g. after `use bevy::image::TextureAtlas`)
If you are using the `bevy` prelude to import these types (e.g. `use
bevy::prelude::*`), you don't need to change anything.
If you are using the `bevy_sprite` subcrate, be sure to add `bevy_image`
as a dependency if you do not already have it, and be sure to update
your import paths.
2025-01-08 05:43:11 +11:00
|
|
|
[dev-dependencies]
|
|
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev" }
|
|
|
|
bevy_sprite = { path = "../bevy_sprite", version = "0.16.0-dev" }
|
|
|
|
|
2024-10-04 16:16:47 -04:00
|
|
|
[lints]
|
|
|
|
workspace = true
|
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
|
|
|
|
all-features = true
|