Skip to content

Commit 7e034a8

Browse files
Firestar99Keavon
authored andcommitted
workspace: remove feature serde, always require it instead
1 parent 0c0551f commit 7e034a8

34 files changed

+161
-297
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ bezier-rs = { path = "libraries/bezier-rs", features = ["dyn-any", "serde"] }
3535
dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam", "reqwest", "log-bad-types", "rc"] }
3636
math-parser = { path = "libraries/math-parser" }
3737
path-bool = { path = "libraries/path-bool" }
38-
graphene-core = { path = "node-graph/gcore", default-features = false }
39-
graph-craft = { path = "node-graph/graph-craft", features = ["serde"] }
38+
graphene-core = { path = "node-graph/gcore" }
39+
graph-craft = { path = "node-graph/graph-craft" }
4040
graphene-std = { path = "node-graph/gstd" }
4141
interpreted-executor = { path = "node-graph/interpreted-executor" }
4242
node-macro = { path = "node-graph/node-macro" }
@@ -130,7 +130,7 @@ kurbo = { version = "0.11.0", features = ["serde"] }
130130
petgraph = { version = "0.7.1", default-features = false, features = [
131131
"graphmap",
132132
] }
133-
half = { version = "2.4.1", default-features = false, features = ["bytemuck"] }
133+
half = { version = "2.4.1", default-features = false, features = ["bytemuck", "serde"] }
134134
tinyvec = { version = "1" }
135135
criterion = { version = "0.5", features = ["html_reports"] }
136136
iai-callgrind = { version = "0.12.3" }

editor/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ ron = ["dep:ron"]
2727
# Local dependencies
2828
graphite-proc-macros = { workspace = true }
2929
graph-craft = { workspace = true }
30-
interpreted-executor = { workspace = true, features = [
31-
"serde",
32-
] }
33-
graphene-std = { workspace = true, features = ["serde"] }
30+
interpreted-executor = { workspace = true }
31+
graphene-std = { workspace = true }
3432

3533
# Workspace dependencies
3634
js-sys = { workspace = true }

node-graph/gcore/Cargo.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ wasm = ["web-sys"]
1414
wgpu = ["dep:wgpu"]
1515
vello = ["dep:vello", "bezier-rs/kurbo", "wgpu"]
1616
dealloc_nodes = []
17-
serde = [
18-
"dep:serde",
19-
"glam/serde",
20-
"bezier-rs/serde",
21-
"bezier-rs/serde",
22-
"half/serde",
23-
"base64",
24-
]
2517

2618
[dependencies]
2719
# Local dependencies
@@ -49,10 +41,10 @@ half = { workspace = true }
4941
tinyvec = { workspace = true }
5042
kurbo = { workspace = true }
5143
log = { workspace = true }
44+
base64 = { workspace = true }
5245

5346
# Optional workspace dependencies
5447
serde = { workspace = true, optional = true }
55-
base64 = { workspace = true, optional = true }
5648
vello = { workspace = true, optional = true }
5749
wgpu = { workspace = true, optional = true }
5850
web-sys = { workspace = true, optional = true }

node-graph/gcore/src/animation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use crate::{Ctx, ExtractAnimationTime, ExtractTime};
22

33
const DAY: f64 = 1000. * 3600. * 24.;
44

5-
#[derive(Debug, Clone, Copy, PartialEq, Eq, dyn_any::DynAny, Default, Hash, node_macro::ChoiceType)]
6-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5+
#[derive(Debug, Clone, Copy, PartialEq, Eq, dyn_any::DynAny, Default, Hash, node_macro::ChoiceType, serde::Serialize, serde::Deserialize)]
76
pub enum RealTimeMode {
87
#[label("UTC")]
98
Utc,

node-graph/gcore/src/application_io.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use std::ptr::addr_of;
1111
use std::sync::Arc;
1212
use std::time::Duration;
1313

14-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
15-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
14+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
1615
pub struct SurfaceId(pub u64);
1716

1817
impl std::fmt::Display for SurfaceId {
@@ -21,8 +20,7 @@ impl std::fmt::Display for SurfaceId {
2120
}
2221
}
2322

24-
#[derive(Debug, Clone, Copy, PartialEq)]
25-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
23+
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
2624
pub struct SurfaceFrame {
2725
pub surface_id: SurfaceId,
2826
pub resolution: UVec2,

node-graph/gcore/src/graphic_element.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ use std::hash::Hash;
1212

1313
pub mod renderer;
1414

15-
#[derive(Copy, Clone, Debug, PartialEq, DynAny, specta::Type)]
16-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
15+
#[derive(Copy, Clone, Debug, PartialEq, DynAny, specta::Type, serde::Serialize, serde::Deserialize)]
1716
#[serde(default)]
1817
pub struct AlphaBlending {
1918
pub blend_mode: BlendMode,
@@ -74,15 +73,13 @@ impl AlphaBlending {
7473
pub fn migrate_graphic_group<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result<GraphicGroupTable, D::Error> {
7574
use serde::Deserialize;
7675

77-
#[derive(Clone, Debug, PartialEq, DynAny, Default)]
78-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
76+
#[derive(Clone, Debug, PartialEq, DynAny, Default, serde::Serialize, serde::Deserialize)]
7977
pub struct OldGraphicGroup {
8078
elements: Vec<(GraphicElement, Option<NodeId>)>,
8179
transform: DAffine2,
8280
alpha_blending: AlphaBlending,
8381
}
84-
#[derive(Clone, Debug, PartialEq, DynAny, Default)]
85-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
82+
#[derive(Clone, Debug, PartialEq, DynAny, Default, serde::Serialize, serde::Deserialize)]
8683
pub struct GraphicGroup {
8784
elements: Vec<(GraphicElement, Option<NodeId>)>,
8885
}
@@ -162,8 +159,7 @@ impl From<RasterDataTable<GPU>> for GraphicGroupTable {
162159
}
163160

164161
/// The possible forms of graphical content held in a Vec by the `elements` field of [`GraphicElement`].
165-
#[derive(Clone, Debug, Hash, PartialEq, DynAny)]
166-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
162+
#[derive(Clone, Debug, Hash, PartialEq, DynAny, serde::Serialize, serde::Deserialize)]
167163
pub enum GraphicElement {
168164
/// Equivalent to the SVG <g> tag: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g
169165
GraphicGroup(GraphicGroupTable),
@@ -279,8 +275,7 @@ impl serde::Serialize for Raster<GPU> {
279275
}
280276

281277
/// Some [`ArtboardData`] with some optional clipping bounds that can be exported.
282-
#[derive(Clone, Debug, Hash, PartialEq, DynAny)]
283-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
278+
#[derive(Clone, Debug, Hash, PartialEq, DynAny, serde::Serialize, serde::Deserialize)]
284279
pub struct Artboard {
285280
pub graphic_group: GraphicGroupTable,
286281
pub label: String,
@@ -313,8 +308,7 @@ impl Artboard {
313308
pub fn migrate_artboard_group<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result<ArtboardGroupTable, D::Error> {
314309
use serde::Deserialize;
315310

316-
#[derive(Clone, Default, Debug, Hash, PartialEq, DynAny)]
317-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
311+
#[derive(Clone, Default, Debug, Hash, PartialEq, DynAny, serde::Serialize, serde::Deserialize)]
318312
pub struct ArtboardGroup {
319313
pub artboards: Vec<(Artboard, Option<NodeId>)>,
320314
}

node-graph/gcore/src/graphic_element/renderer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ pub fn to_transform(transform: DAffine2) -> usvg::Transform {
350350

351351
// TODO: Click targets can be removed from the render output, since the vector data is available in the vector modify data from Monitor nodes.
352352
// This will require that the transform for child layers into that layer space be calculated, or it could be returned from the RenderOutput instead of click targets.
353-
#[derive(Debug, Default, Clone, PartialEq, DynAny)]
354-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
353+
#[derive(Debug, Default, Clone, PartialEq, DynAny, serde::Serialize, serde::Deserialize)]
355354
pub struct RenderMetadata {
356355
pub upstream_footprints: HashMap<NodeId, Footprint>,
357356
pub local_transforms: HashMap<NodeId, DAffine2>,

node-graph/gcore/src/memo.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ pub struct MemoHash<T: Hash> {
149149
value: T,
150150
}
151151

152-
#[cfg(feature = "serde")]
153152
impl<'de, T: serde::Deserialize<'de> + Hash> serde::Deserialize<'de> for MemoHash<T> {
154153
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
155154
where
@@ -159,7 +158,6 @@ impl<'de, T: serde::Deserialize<'de> + Hash> serde::Deserialize<'de> for MemoHas
159158
}
160159
}
161160

162-
#[cfg(feature = "serde")]
163161
impl<T: Hash + serde::Serialize> serde::Serialize for MemoHash<T> {
164162
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
165163
where

node-graph/gcore/src/ops.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ fn extract_xy<T: Into<DVec2>>(_: impl Ctx, #[implementations(DVec2, IVec2, UVec2
530530
}
531531

532532
/// The X or Y component of a coordinate.
533-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
534-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
533+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
535534
#[widget(Dropdown)]
536535
pub enum XY {
537536
#[default]

node-graph/gcore/src/raster.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ impl<T: Rec709Primaries> RGBPrimaries for T {
110110

111111
pub trait SRGB: Rec709Primaries {}
112112

113-
#[cfg(feature = "serde")]
114113
pub trait Serde: serde::Serialize + for<'a> serde::Deserialize<'a> {}
115114
#[cfg(not(feature = "serde"))]
116115
pub trait Serde {}
117116

118-
#[cfg(feature = "serde")]
119117
impl<T: serde::Serialize + for<'a> serde::Deserialize<'a>> Serde for T {}
120118
#[cfg(not(feature = "serde"))]
121119
impl<T> Serde for T {}

node-graph/gcore/src/raster/adjustments.rs

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ use std::fmt::Debug;
2929
// https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=%27clrL%27%20%3D%20Color%20Lookup
3030
// https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Color%20Lookup%20(Photoshop%20CS6
3131

32-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
33-
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, DynAny, Hash, node_macro::ChoiceType, specta::Type)]
32+
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, DynAny, Hash, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
3433
#[widget(Dropdown)]
3534
pub enum LuminanceCalculation {
3635
#[default]
@@ -42,8 +41,7 @@ pub enum LuminanceCalculation {
4241
MaximumChannels,
4342
}
4443

45-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
46-
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, DynAny, Hash, specta::Type)]
44+
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, DynAny, Hash, specta::Type, serde::Serialize, serde::Deserialize)]
4745
#[repr(i32)] // TODO: Enable Int8 capability for SPIR-V so that we don't need this?
4846
pub enum BlendMode {
4947
// Basic group
@@ -916,8 +914,7 @@ async fn vibrance<T: Adjust<Color>>(
916914
}
917915

918916
/// Color Channel
919-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
920-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
917+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
921918
#[widget(Radio)]
922919
pub enum RedGreenBlue {
923920
#[default]
@@ -927,8 +924,7 @@ pub enum RedGreenBlue {
927924
}
928925

929926
/// Color Channel
930-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
931-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
927+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
932928
#[widget(Radio)]
933929
pub enum RedGreenBlueAlpha {
934930
#[default]
@@ -939,8 +935,7 @@ pub enum RedGreenBlueAlpha {
939935
}
940936

941937
/// Style of noise pattern
942-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
943-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
938+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
944939
#[widget(Dropdown)]
945940
pub enum NoiseType {
946941
#[default]
@@ -955,8 +950,7 @@ pub enum NoiseType {
955950
WhiteNoise,
956951
}
957952

958-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
959-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
953+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
960954
/// Style of layered levels of the noise pattern
961955
pub enum FractalType {
962956
#[default]
@@ -972,8 +966,7 @@ pub enum FractalType {
972966
}
973967

974968
/// Distance function used by the cellular noise
975-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
976-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
969+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
977970
pub enum CellularDistanceFunction {
978971
#[default]
979972
Euclidean,
@@ -983,8 +976,7 @@ pub enum CellularDistanceFunction {
983976
Hybrid,
984977
}
985978

986-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
987-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
979+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
988980
pub enum CellularReturnType {
989981
CellValue,
990982
#[default]
@@ -1003,8 +995,7 @@ pub enum CellularReturnType {
1003995
}
1004996

1005997
/// Type of domain warp
1006-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1007-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
998+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
1008999
#[widget(Dropdown)]
10091000
pub enum DomainWarpType {
10101001
#[default]
@@ -1113,8 +1104,7 @@ async fn channel_mixer<T: Adjust<Color>>(
11131104
image
11141105
}
11151106

1116-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1117-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
1107+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
11181108
#[widget(Radio)]
11191109
pub enum RelativeAbsolute {
11201110
#[default]
@@ -1123,8 +1113,7 @@ pub enum RelativeAbsolute {
11231113
}
11241114

11251115
#[repr(C)]
1126-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1127-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type)]
1116+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, DynAny, node_macro::ChoiceType, specta::Type, serde::Serialize, serde::Deserialize)]
11281117
pub enum SelectiveColorChoice {
11291118
#[default]
11301119
Reds,

node-graph/gcore/src/raster/brush_cache.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ use std::hash::Hash;
99
use std::sync::Arc;
1010
use std::sync::Mutex;
1111

12-
#[derive(Clone, Debug, PartialEq, DynAny, Default)]
13-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12+
#[derive(Clone, Debug, PartialEq, DynAny, Default, serde::Serialize, serde::Deserialize)]
1413
struct BrushCacheImpl {
1514
// The full previous input that was cached.
1615
prev_input: Vec<BrushStroke>,
1716

1817
// The strokes that have been fully processed and blended into the background.
19-
#[cfg_attr(feature = "serde", serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance"))]
18+
#[serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance")]
2019
background: Instance<Raster<CPU>>,
21-
#[cfg_attr(feature = "serde", serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance"))]
20+
#[serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance")]
2221
blended_image: Instance<Raster<CPU>>,
23-
#[cfg_attr(feature = "serde", serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance"))]
22+
#[serde(deserialize_with = "crate::graphene_core::raster::image::migrate_image_frame_instance")]
2423
last_stroke_texture: Instance<Raster<CPU>>,
2524

2625
// A cache for brush textures.
27-
#[cfg_attr(feature = "serde", serde(skip))]
26+
#[serde(skip)]
2827
brush_texture_cache: HashMap<BrushStyle, Raster<CPU>>,
2928
}
3029

@@ -104,8 +103,7 @@ pub struct BrushPlan {
104103
pub first_stroke_point_skip: usize,
105104
}
106105

107-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
108-
#[derive(Debug, DynAny)]
106+
#[derive(Debug, DynAny, serde::Serialize, serde::Deserialize)]
109107
pub struct BrushCache {
110108
inner: Arc<Mutex<BrushCacheImpl>>,
111109
proto: bool,

node-graph/gcore/src/raster/color.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use spirv_std::num_traits::float::Float;
1010
use std::hash::Hash;
1111

1212
#[repr(C)]
13-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
14-
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable)]
13+
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, serde::Serialize, serde::Deserialize)]
1514
pub struct RGBA16F {
1615
red: f16,
1716
green: f16,
@@ -83,8 +82,7 @@ impl Alpha for RGBA16F {
8382
impl Pixel for RGBA16F {}
8483

8584
#[repr(C)]
86-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
87-
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type)]
85+
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type, serde::Serialize, serde::Deserialize)]
8886
pub struct SRGBA8 {
8987
red: u8,
9088
green: u8,
@@ -164,8 +162,7 @@ impl Alpha for SRGBA8 {
164162
impl Pixel for SRGBA8 {}
165163

166164
#[repr(C)]
167-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
168-
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type)]
165+
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type, serde::Serialize, serde::Deserialize)]
169166
pub struct Luma(pub f32);
170167

171168
impl Luminance for Luma {
@@ -205,8 +202,7 @@ impl Pixel for Luma {}
205202
/// The other components (RGB) are stored as `f32` that range from `0.0` up to `f32::MAX`,
206203
/// the values encode the brightness of each channel proportional to the light intensity in cd/m² (nits) in HDR, and `0.0` (black) to `1.0` (white) in SDR color.
207204
#[repr(C)]
208-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
209-
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type)]
205+
#[derive(Debug, Default, Clone, Copy, PartialEq, DynAny, Pod, Zeroable, specta::Type, serde::Serialize, serde::Deserialize)]
210206
pub struct Color {
211207
red: f32,
212208
green: f32,

0 commit comments

Comments
 (0)