25 ImageSpec config, spec;
43 int bits_per_sample = 8;
54 const int file_channels = ibuf->
planes >> 3;
55 const TypeDesc data_format = bits_per_sample == 8 ? TypeDesc::UINT8 : TypeDesc::UINT16;
60 const float max_value =
powf(2, bits_per_sample) - 1.0f;
61 file_spec.attribute(
"oiio:BitsPerSample", bits_per_sample);
62 file_spec.attribute(
"dpx:WhiteLevel", 685.0f / 1023.0f * max_value);
63 file_spec.attribute(
"dpx:BlackLevel", 95.0f / 1023.0f * max_value);
64 file_spec.attribute(
"dpx:HighData", max_value);
65 file_spec.attribute(
"dpx:LowData", 0);
66 file_spec.attribute(
"dpx:LowQuantity", 0.0f);
70 file_spec.attribute(
"dpx:Transfer",
"Printing density");
71 file_spec.attribute(
"dpx:HighQuantity", 2.048f);
74 file_spec.attribute(
"dpx:Transfer",
"Linear");
75 file_spec.attribute(
"dpx:HighQuantity", max_value);
78 if (
ELEM(bits_per_sample, 8, 16)) {
79 file_spec.attribute(
"dpx:Packing",
"Packed");
82 file_spec.attribute(
"dpx:Packing",
"Filled, method A");
@ COLOR_ROLE_DEFAULT_FLOAT
Contains defines and structs used throughout the imbuf module.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
bool imb_oiio_write(const WriteContext &ctx, const char *filepath, const ImageSpec &file_spec)
WriteContext imb_create_write_context(const char *file_format, ImBuf *ibuf, int flags, bool prefer_float)
ImBuf * imb_oiio_read(const ReadContext &ctx, const ImageSpec &config, char colorspace[IM_MAX_SPACE], ImageSpec &r_newspec)
bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format)
ImageSpec imb_create_write_spec(const WriteContext &ctx, int file_channels, TypeDesc data_format)
ImbFormatOptions foptions