mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 23:38:11 +08:00
Instance tables refactor part 7: Rename "ImageFrame" -> "RasterData", "ImageFrameTable" -> "RasterDataType", and "RasterFrame" -> "RasterDataType"
This commit is contained in:
@@ -4,7 +4,7 @@ use crate::raster::curve::{CubicSplines, CurveManipulatorGroup};
|
||||
#[cfg(feature = "alloc")]
|
||||
use crate::raster::curve::{Curve, ValueMapperNode};
|
||||
#[cfg(feature = "alloc")]
|
||||
use crate::raster::image::{Image, ImageFrameTable};
|
||||
use crate::raster::image::{Image, RasterDataTable};
|
||||
use crate::raster::{Channel, Color, Pixel};
|
||||
use crate::registry::types::{Angle, Percentage, SignedPercentage};
|
||||
use crate::vector::VectorDataTable;
|
||||
@@ -265,7 +265,7 @@ fn luminance<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -289,7 +289,7 @@ fn extract_channel<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -312,7 +312,7 @@ fn make_opaque<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -337,7 +337,7 @@ fn brightness_contrast<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -426,7 +426,7 @@ fn levels<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -493,7 +493,7 @@ async fn black_and_white<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -565,7 +565,7 @@ async fn hue_saturation<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -599,7 +599,7 @@ async fn invert<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -621,7 +621,7 @@ async fn threshold<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -663,7 +663,7 @@ impl Blend<Color> for Option<Color> {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Blend<Color> for ImageFrameTable<Color> {
|
||||
impl Blend<Color> for RasterDataTable<Color> {
|
||||
fn blend(&self, under: &Self, blend_fn: impl Fn(Color, Color) -> Color) -> Self {
|
||||
let mut result_table = self.clone();
|
||||
|
||||
@@ -706,14 +706,14 @@ async fn blend<T: Blend<Color> + Send>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
over: T,
|
||||
#[expose]
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
under: T,
|
||||
@@ -795,7 +795,7 @@ impl Adjust<Color> for GradientStops {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<P: Pixel> Adjust<P> for ImageFrameTable<P>
|
||||
impl<P: Pixel> Adjust<P> for RasterDataTable<P>
|
||||
where
|
||||
GraphicElement: From<Image<P>>,
|
||||
{
|
||||
@@ -829,7 +829,7 @@ async fn gradient_map<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -865,7 +865,7 @@ async fn vibrance<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -1037,7 +1037,7 @@ async fn channel_mixer<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -1166,7 +1166,7 @@ async fn selective_color<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -1309,7 +1309,7 @@ impl MultiplyAlpha for GraphicGroupTable {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<P: Pixel> MultiplyAlpha for ImageFrameTable<P>
|
||||
impl<P: Pixel> MultiplyAlpha for RasterDataTable<P>
|
||||
where
|
||||
GraphicElement: From<Image<P>>,
|
||||
{
|
||||
@@ -1331,7 +1331,7 @@ async fn posterize<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -1364,7 +1364,7 @@ async fn exposure<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut input: T,
|
||||
@@ -1438,7 +1438,7 @@ fn color_overlay<T: Adjust<Color>>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
Color,
|
||||
ImageFrameTable<Color>,
|
||||
RasterDataTable<Color>,
|
||||
GradientStops,
|
||||
)]
|
||||
mut image: T,
|
||||
@@ -1488,7 +1488,7 @@ fn color_overlay<T: Adjust<Color>>(
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::raster::adjustments::BlendMode;
|
||||
use crate::raster::image::{Image, ImageFrameTable};
|
||||
use crate::raster::image::{Image, RasterDataTable};
|
||||
use crate::{Color, Node};
|
||||
use std::pin::Pin;
|
||||
|
||||
@@ -1514,7 +1514,7 @@ mod test {
|
||||
// 100% of the output should come from the multiplied value
|
||||
let opacity = 100_f64;
|
||||
|
||||
let result = super::color_overlay((), ImageFrameTable::new(image.clone()), overlay_color, BlendMode::Multiply, opacity);
|
||||
let result = super::color_overlay((), RasterDataTable::new(image.clone()), overlay_color, BlendMode::Multiply, opacity);
|
||||
let result = result.instance_ref_iter().next().unwrap().instance;
|
||||
|
||||
// The output should just be the original green and alpha channels (as we multiply them by 1 and other channels by 0)
|
||||
|
||||
Reference in New Issue
Block a user