void ImfHeaderSetDataWindow (ImfHeader *hdr, int xMin, int yMin, int xMax, int yMax) { header(hdr)->dataWindow() = Box2i (V2i (xMin, yMin), V2i (xMax, yMax)); }
int ImfHeaderSetBox2iAttribute (ImfHeader *hdr, const char name[], int xMin, int yMin, int xMax, int yMax) { try { Box2i box (V2i (xMin, yMin), V2i (xMax, yMax)); if (header(hdr)->find(name) == header(hdr)->end()) { header(hdr)->insert (name, Imf::Box2iAttribute (box)); } else { header(hdr)->typedAttribute<Imf::Box2iAttribute>(name).value() = box; } return 1; } catch (const std::exception &e) { setErrorMessage (e); return 0; } }
Header::Header (int width, int height, float pixelAspectRatio, const V2f &screenWindowCenter, float screenWindowWidth, LineOrder lineOrder, Compression compression) : _map() { staticInitialize(); Box2i displayWindow (V2i (0, 0), V2i (width - 1, height - 1)); initialize (*this, displayWindow, displayWindow, pixelAspectRatio, screenWindowCenter, screenWindowWidth, lineOrder, compression); }