core: merge oak-common into oak-core
CI / Build & test (Linux) (push) Successful in 24m6s
CI / Build & test (Windows) (push) Successful in 31m14s

oak-common is gone; its modules (configstore, xmlutils, ocioutils,
oiioutils, colormath, colortransform, videoparams, ffmpegutils, ...)
now live in oak-core alongside the value types. The render value/GPU
types moved too: backend (wgpu context + DisplayRenderer), color
(ColorProcessor over ocio-rs), texture, frame, and the commonutil
config helpers.

Fix-ups to make the merged tree build and pass tests:

- oak-core Cargo.toml: wgpu back to 25 (the moved backend code is
  written against that API generation); add the toml/quick-xml/image
  deps oak-common carried.
- lib.rs: drop the duplicate 'pub mod error;'.
- error.rs: unified OAKCORE_* codes; restore Error::new() and
  From<OcioError> from oak-common's error type.
- backend.rs/color.rs: oak_core::/oak_render:: self-references
  rewritten to crate::; the shaderfx-dependent GPU effect test moved
  to oak-render's shaderfx tests (shaderfx depends on oak-node and
  cannot live in oak-core).
- oak-render's error module re-exports oak_core::error::{Error,
  Result}; the OAKRENDER_* codes stay as the public-code contract.
- oak-node jobs.rs: ColorProcessor imported from oak_core::color.
- Integration tests repointed at oak_core::{texture, frame, backend,
  color, colormath}.
- the display-ICC regression test treats an empty OAK_DISPLAY_ICC as
  unset, matching displayicc::env_override_icc.
This commit is contained in:
2026-09-03 17:42:20 +08:00
parent 49fed365a4
commit 4babbf5de8
150 changed files with 3052 additions and 4030 deletions
+2 -2
View File
@@ -27,8 +27,8 @@ use std::time::Duration;
use oak_core::{Rational, TimeRange};
use oak_render::error::Error;
use oak_render::frame::VideoParamsPod;
use oak_render::texture::{Frame, Texture};
use oak_core::frame::VideoParamsPod;
use oak_core::texture::{Frame, Texture};
use oak_render::ticket::TicketArena;
use oak_render::worker::{InlineDispatcher, JobDispatch};
@@ -24,7 +24,7 @@
use oak_core::{PixelFormat, Rational};
use oak_render::texture::Texture;
use oak_core::texture::Texture;
mod common;
@@ -38,9 +38,9 @@ fn footage_decode_renders_known_content() {
// the color pipeline. Pin the working space to the legacy sRGB
// pass-through so the decoded pixels stay display-referred and the
// assertions below hold regardless of the ACEScg default.
oak_render::color::set_pipeline_color_settings(
oak_common::colormath::WorkingColorSpace::SrgbLegacy,
oak_common::colormath::OutputColorSpec::default(),
oak_core::color::set_pipeline_color_settings(
oak_core::colormath::WorkingColorSpace::SrgbLegacy,
oak_core::colormath::OutputColorSpec::default(),
);
// Program-generated media: 10 frames at 10fps, 64x64, known pattern
+8 -8
View File
@@ -33,7 +33,7 @@ use oak_node::project::Project;
use oak_node::sequence::SequenceBehavior;
use oak_node::track::{TrackBehavior, TrackListBehavior};
use oak_render::texture::Texture;
use oak_core::texture::Texture;
mod common;
@@ -49,9 +49,9 @@ fn clip_path(tag: &str) -> std::path::PathBuf {
/// pixel-value assertions hold regardless of the ACEScg default. All tests
/// in this binary set the same value, so the shared global is race-free.
fn pin_legacy_working_space() {
oak_render::color::set_pipeline_color_settings(
oak_common::colormath::WorkingColorSpace::SrgbLegacy,
oak_common::colormath::OutputColorSpec::default(),
oak_core::color::set_pipeline_color_settings(
oak_core::colormath::WorkingColorSpace::SrgbLegacy,
oak_core::colormath::OutputColorSpec::default(),
);
}
@@ -366,7 +366,7 @@ fn channel(data: &[u8], x: usize, y: usize, c: usize) -> f32 {
/// when no GPU adapter exists.
#[test]
fn shader_job_opacity_halves_pixels() {
if oak_render::backend::GpuContext::shared().is_none() {
if oak_core::backend::GpuContext::shared().is_none() {
eprintln!("skipping shader_job_opacity_halves_pixels: no GPU adapter");
return;
}
@@ -452,7 +452,7 @@ fn shader_job_opacity_halves_pixels() {
/// boundary pixel on the right half. Skipped when no GPU adapter exists.
#[test]
fn shader_job_blur_smooths_edge() {
if oak_render::backend::GpuContext::shared().is_none() {
if oak_core::backend::GpuContext::shared().is_none() {
eprintln!("skipping shader_job_blur_smooths_edge: no GPU adapter");
return;
}
@@ -554,11 +554,11 @@ fn shader_job_blur_smooths_edge() {
/// Skipped when no GPU adapter or OCIO config exists.
#[test]
fn chromakey_job_keys_green_with_ociobased_stub() {
if oak_render::backend::GpuContext::shared().is_none() {
if oak_core::backend::GpuContext::shared().is_none() {
eprintln!("skipping chromakey_job_keys_green_with_ociobased_stub: no GPU adapter");
return;
}
if oak_render::color::set_up_default_config().is_err() {
if oak_core::color::set_up_default_config().is_err() {
eprintln!("skipping chromakey_job_keys_green_with_ociobased_stub: no OCIO config");
return;
}
+7 -7
View File
@@ -27,9 +27,9 @@ mod common;
use oak_core::{PixelFormat, Rational};
use oak_render::backend::{BackendKind, DisplayRenderer, GpuContext};
use oak_render::frame::VideoParamsPod;
use oak_render::texture::{Frame, Texture};
use oak_core::backend::{BackendKind, DisplayRenderer, GpuContext};
use oak_core::frame::VideoParamsPod;
use oak_core::texture::{Frame, Texture};
/// A frame rendered through the CPU backend is F32 RGBA (not u8) and
/// preserves out-of-[0,1] HDR values without clamping.
@@ -64,11 +64,11 @@ fn cpu_path_stays_f32_unclamped() {
/// (CPU path; the GPU color-managed path is documented-deferred).
#[test]
fn blit_applies_ocio_in_float() {
let _ = oak_render::color::set_up_default_config();
let processor = oak_render::color::ColorProcessor::create(
let _ = oak_core::color::set_up_default_config();
let processor = oak_core::color::ColorProcessor::create(
"ACEScg",
"sRGB Encoded Rec.709 (sRGB)",
oak_render::color::Direction::Normal,
oak_core::color::Direction::Normal,
)
.expect("handle always returned");
if !processor.is_valid() {
@@ -118,7 +118,7 @@ fn blit_applies_ocio_in_float() {
.blit_color_managed(
Some(&src),
&mut dst,
Some(&oak_render::color::ColorProcessor::pass_through()),
Some(&oak_core::color::ColorProcessor::pass_through()),
)
.unwrap();
}
@@ -27,13 +27,13 @@ use std::time::Duration;
use oak_core::{Rational, TimeRange};
use oak_render::error::Error;
use oak_render::frame::VideoParamsPod;
use oak_render::texture::{Frame, Texture};
use oak_core::frame::VideoParamsPod;
use oak_core::texture::{Frame, Texture};
use oak_render::ticket::{TicketArena, TicketId, VideoTicketParams};
use oak_render::worker::{GraphSnapshotStore, InlineDispatcher, JobDispatch};
/// Unwrap a video ticket payload for assertions.
fn res_video(res: &oak_render::ticket::TicketPayload) -> &oak_render::texture::Texture {
fn res_video(res: &oak_render::ticket::TicketPayload) -> &oak_core::texture::Texture {
match res {
oak_render::ticket::TicketPayload::Video(t) => t,
_ => panic!("expected a video payload"),