def test_write_and_readback(self): """Write and read back a preset """ preset = {presets.TYPE: '1D'} preset = CSP_HELPER.complete_preset(preset) presets.write_preset(self.preset_path, preset) back_preset = presets.read_preset(self.preset_path) expression = set(back_preset).issubset(set(preset)) self.assert_(expression, ("Something went wrong in preset write and read :\n" "Write preset:\n{0}\nRead one:\n{1}" ).format(preset, back_preset))
def test_convert_from_preset(self): """Read a preset file and write a LUT """ preset = presets.read_preset(self.sample_preset) outlutfile = os.path.join(self.tmp_dir, 'test_preset.cube') lut_to_lut(self.lut3d, preset=preset, outlutfile=outlutfile) proc = create_ocio_processor(outlutfile, interpolation=INTERP_LINEAR) proc.applyRGB([0, 0, 0]) proc.applyRGB([1, 1, 1]) if DISPLAY: import plot_that_lut plot_that_lut.plot_that_lut(outlutfile)