| 271 | const Writer::WriterDescription<ImageWriter> ImageWriter::g_writerDescription( OpenImageIOAlgo::extensions() ); |
| 272 | |
| 273 | ImageWriter::ImageWriter() |
| 274 | : Writer( "Serializes images to disk using OpenImageIO", (IECore::TypeId)ImagePrimitiveTypeId ) |
| 275 | { |
| 276 | m_channelsParameter = new StringVectorParameter( "channels", "The list of channels to write. No list causes all channels to be written." ); |
| 277 | |
| 278 | m_rawChannelsParameter = new BoolParameter( |
| 279 | "rawChannels", |
| 280 | "Specifies if the input data channels should be stored in the file without further processing. " |
| 281 | "Note that the formatSettings still take precedence.", |
| 282 | false |
| 283 | ); |
| 284 | |
| 285 | m_formatSettingsParameter = new CompoundParameter( "formatSettings", "Settings specific to various file formats" ); |
| 286 | |
| 287 | CompoundParameterPtr exrSettings = new CompoundParameter( "openexr", "OpenEXR specific settings" ); |
| 288 | m_formatSettingsParameter->addParameter( exrSettings ); |
| 289 | exrSettings->addParameter( |
| 290 | new StringParameter( |
| 291 | "compression", |
| 292 | "OpenEXR compression", |
| 293 | "zips", |
| 294 | /* presets = */ { |
| 295 | { "none", "none" }, |
| 296 | { "rle", "rle" }, |
| 297 | { "zips", "zips" }, |
| 298 | { "zip", "zip" }, |
| 299 | { "piz", "piz" }, |
| 300 | { "pxr24", "pxr24" }, |
| 301 | { "b44", "b44" }, |
| 302 | { "b44a", "b44a" }, |
| 303 | { "dwaa", "dwaa" }, |
| 304 | { "dwab", "dwab" } |
| 305 | }, |
| 306 | /* presetsOnly */ true |
| 307 | ) |
| 308 | ); |
| 309 | |
| 310 | exrSettings->addParameter( |
| 311 | new StringParameter( |
| 312 | "dataType", |
| 313 | "Format of the data to write. OpenImageIO will convert the PrimitiveVariables to this format automatically", |
| 314 | "half", |
| 315 | /* presets = */ { |
| 316 | { "half", "half" }, |
| 317 | { "float", "float" }, |
| 318 | { "double", "double" } |
| 319 | }, |
| 320 | /* presetsOnly */ true |
| 321 | ) |
| 322 | ); |
| 323 | |
| 324 | CompoundParameterPtr dpxSettings = new CompoundParameter( "dpx", "dpx specific settings" ); |
| 325 | m_formatSettingsParameter->addParameter( dpxSettings ); |
| 326 | dpxSettings->addParameter( |
| 327 | new StringParameter( |
| 328 | "dataType", |
| 329 | "Format of the data to write. OpenImageIO will convert the PrimitiveVariables to this format automatically", |
| 330 | "uint10", |