| 1 | |
| 2 | //! Contains collections of common attributes. |
| 3 | //! Defines some data types that list all standard attributes. |
| 4 | |
| 5 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#; |
| 6 | use craterust-analyzer cargo exr 1.74.0 crate/::metarust-analyzer cargo exr 1.74.0 meta/::attributerust-analyzer cargo exr 1.74.0 meta/attribute/::*; // FIXME shouldn't this need some more imports???? |
| 7 | use craterust-analyzer cargo exr 1.74.0 crate/::metarust-analyzer cargo exr 1.74.0 meta/::*; |
| 8 | use craterust-analyzer cargo exr 1.74.0 crate/::mathrust-analyzer cargo exr 1.74.0 math/::Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#; |
| 9 | |
| 10 | // TODO rename header to LayerDescription! |
| 11 | |
| 12 | /// Describes a single layer in a file. |
| 13 | /// A file can have any number of layers. |
| 14 | /// The meta data contains one header per layer. |
| 15 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 16 | pub struct Headerrust-analyzer cargo exr 1.74.0 meta/header/Header# { |
| 17 | |
| 18 | /// List of channels in this layer. |
| 19 | pub channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels.: ChannelListrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelList#, |
| 20 | |
| 21 | /// How the pixel data of all channels in this layer is compressed. May be `Compression::Uncompressed`. |
| 22 | pub compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression.: Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#, |
| 23 | |
| 24 | /// Describes how the pixels of this layer are divided into smaller blocks. |
| 25 | /// A single block can be loaded without processing all bytes of a file. |
| 26 | /// |
| 27 | /// Also describes whether a file contains multiple resolution levels: mip maps or rip maps. |
| 28 | /// This allows loading not the full resolution, but the smallest sensible resolution. |
| 29 | // |
| 30 | // Required if file contains deep data or multiple layers. |
| 31 | // Note: This value must agree with the version field's tile bit and deep data bit. |
| 32 | // In this crate, this attribute will always have a value, for simplicity. |
| 33 | pub blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks.: BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#, |
| 34 | |
| 35 | /// In what order the tiles of this header occur in the file. |
| 36 | pub line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order.: LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#, |
| 37 | |
| 38 | /// The resolution of this layer. Equivalent to the size of the `DataWindow`. |
| 39 | pub layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>, |
| 40 | |
| 41 | /// Whether this layer contains deep data. |
| 42 | pub deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep.: bool, |
| 43 | |
| 44 | /// This library supports only deep data version 1. |
| 45 | pub deep_data_versionrust-analyzer cargo exr 1.74.0 meta/header/Header#deep_data_version.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<i32>, |
| 46 | |
| 47 | /// Number of chunks, that is, scan line blocks or tiles, that this image has been divided into. |
| 48 | /// This number is calculated once at the beginning |
| 49 | /// of the read process or when creating a header object. |
| 50 | /// |
| 51 | /// This value includes all chunks of all resolution levels. |
| 52 | /// |
| 53 | /// |
| 54 | /// __Warning__ |
| 55 | /// _This value is relied upon. You should probably use `Header::with_encoding`, |
| 56 | /// which automatically updates the chunk count._ |
| 57 | pub chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count.: usize, |
| 58 | |
| 59 | // Required for deep data (deepscanline and deeptile) layers. |
| 60 | // Note: Since the value of "maxSamplesPerPixel" |
| 61 | // maybe be unknown at the time of opening the |
| 62 | // file, the value “ -1 ” is written to the file to |
| 63 | // indicate an unknown value. When the file is |
| 64 | // closed, this will be overwritten with the correct value. |
| 65 | // If file writing does not complete |
| 66 | // correctly due to an error, the value -1 will |
| 67 | // remain. In this case, the value must be derived |
| 68 | // by decoding each chunk in the layer |
| 69 | /// Maximum number of samples in a single pixel in a deep image. |
| 70 | pub max_samples_per_pixelrust-analyzer cargo exr 1.74.0 meta/header/Header#max_samples_per_pixel.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>, |
| 71 | |
| 72 | /// Includes mandatory fields like pixel aspect or display window |
| 73 | /// which must be the same for all layers. |
| 74 | pub shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes.: ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#, |
| 75 | |
| 76 | /// Does not include the attributes required for reading the file contents. |
| 77 | /// Excludes standard fields that must be the same for all headers. |
| 78 | pub own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes.: LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#, |
| 79 | } |
| 80 | |
| 81 | /// Includes mandatory fields like pixel aspect or display window |
| 82 | /// which must be the same for all layers. |
| 83 | /// For more attributes, see struct `LayerAttributes`. |
| 84 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 85 | pub struct ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes# { |
| 86 | |
| 87 | /// The rectangle anywhere in the global infinite 2D space |
| 88 | /// that clips all contents of the file. |
| 89 | pub display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window.: IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#, |
| 90 | |
| 91 | /// Aspect ratio of each pixel in this header. |
| 92 | pub pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect.: f32, |
| 93 | |
| 94 | /// The chromaticities attribute of the image. See the `Chromaticities` type. |
| 95 | pub chromaticitiesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#chromaticities.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Chromaticitiesrust-analyzer cargo exr 1.74.0 meta/attribute/Chromaticities#>, |
| 96 | |
| 97 | /// The time code of the image. |
| 98 | pub time_coderust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#time_code.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<TimeCoderust-analyzer cargo exr 1.74.0 meta/attribute/TimeCode#>, |
| 99 | |
| 100 | /// Contains custom attributes. |
| 101 | /// Does not contain the attributes already present in the `ImageAttributes`. |
| 102 | /// Contains only attributes that are standardized to be the same for all headers: chromaticities and time codes. |
| 103 | pub otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other.: HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#>, |
| 104 | } |
| 105 | |
| 106 | /// Does not include the attributes required for reading the file contents. |
| 107 | /// Excludes standard fields that must be the same for all headers. |
| 108 | /// For more attributes, see struct `ImageAttributes`. |
| 109 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 110 | pub struct LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes# { |
| 111 | |
| 112 | /// The name of this layer. |
| 113 | /// Required if this file contains deep data or multiple layers. |
| 114 | // As this is an attribute value, it is not restricted in length, may even be empty |
| 115 | pub layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 116 | |
| 117 | /// The top left corner of the rectangle that positions this layer |
| 118 | /// within the global infinite 2D space of the whole file. |
| 119 | /// This represents the position of the `DataWindow`. |
| 120 | pub layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<i32>, |
| 121 | |
| 122 | /// Part of the perspective projection. Default should be `(0, 0)`. |
| 123 | // TODO same for all layers? |
| 124 | pub screen_window_centerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_center.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<f32>, |
| 125 | |
| 126 | // TODO same for all layers? |
| 127 | /// Part of the perspective projection. Default should be `1`. |
| 128 | pub screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width.: f32, |
| 129 | |
| 130 | /// The white luminance of the colors. |
| 131 | /// Defines the luminance in candelas per square meter, Nits, of the rgb value `(1, 1, 1)`. |
| 132 | // If the chromaticities and the whiteLuminance of an RGB image are |
| 133 | // known, then it is possible to convert the image's pixels from RGB |
| 134 | // to CIE XYZ tristimulus values (see function RGBtoXYZ() in header |
| 135 | // file ImfChromaticities.h). |
| 136 | pub white_luminancerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#white_luminance.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 137 | |
| 138 | /// The adopted neutral of the colors. Specifies the CIE (x,y) frequency coordinates that should |
| 139 | /// be considered neutral during color rendering. Pixels in the image |
| 140 | /// whose CIE (x,y) frequency coordinates match the adopted neutral value should |
| 141 | /// be mapped to neutral values on the given display. |
| 142 | pub adopted_neutralrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#adopted_neutral.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<f32>>, |
| 143 | |
| 144 | /// Name of the color transform function that is applied for rendering the image. |
| 145 | pub rendering_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#rendering_transform_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 146 | |
| 147 | /// Name of the color transform function that computes the look modification of the image. |
| 148 | pub look_modification_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#look_modification_transform_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 149 | |
| 150 | /// The horizontal density, in pixels per inch. |
| 151 | /// The image's vertical output density can be computed using `horizontal_density * pixel_aspect_ratio`. |
| 152 | pub horizontal_densityrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_density.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 153 | |
| 154 | /// Name of the owner. |
| 155 | pub ownerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#owner.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 156 | |
| 157 | /// Additional textual information. |
| 158 | pub commentsrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#comments.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 159 | |
| 160 | /// The date of image creation, in `YYYY:MM:DD hh:mm:ss` format. |
| 161 | // TODO parse! |
| 162 | pub capture_daterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#capture_date.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 163 | |
| 164 | /// Time offset from UTC. |
| 165 | pub utc_offsetrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#utc_offset.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 166 | |
| 167 | /// Geographical image location. |
| 168 | pub longituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#longitude.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 169 | |
| 170 | /// Geographical image location. |
| 171 | pub latituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#latitude.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 172 | |
| 173 | /// Geographical image location. |
| 174 | pub altituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#altitude.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 175 | |
| 176 | /// Camera focus in meters. |
| 177 | pub focusrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#focus.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 178 | |
| 179 | /// Exposure time in seconds. |
| 180 | pub exposurerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#exposure.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 181 | |
| 182 | /// Camera aperture measured in f-stops. Equals the focal length |
| 183 | /// of the lens divided by the diameter of the iris opening. |
| 184 | pub aperturerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#aperture.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 185 | |
| 186 | /// Iso-speed of the camera sensor. |
| 187 | pub iso_speedrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#iso_speed.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 188 | |
| 189 | /// If this is an environment map, specifies how to interpret it. |
| 190 | pub environment_maprust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#environment_map.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<EnvironmentMaprust-analyzer cargo exr 1.74.0 meta/attribute/EnvironmentMap#>, |
| 191 | |
| 192 | /// Identifies film manufacturer, film type, film roll and frame position within the roll. |
| 193 | pub film_key_coderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#film_key_code.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<KeyCoderust-analyzer cargo exr 1.74.0 meta/attribute/KeyCode#>, |
| 194 | |
| 195 | /// Specifies how texture map images are extrapolated. |
| 196 | /// Values can be `black`, `clamp`, `periodic`, or `mirror`. |
| 197 | pub wrap_mode_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#wrap_mode_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 198 | |
| 199 | /// Frames per second if this is a frame in a sequence. |
| 200 | pub frames_per_secondrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#frames_per_second.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/Rational#>, |
| 201 | |
| 202 | /// Specifies the view names for multi-view, for example stereo, image files. |
| 203 | pub multi_view_namesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#multi_view_names.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>>, |
| 204 | |
| 205 | /// The matrix that transforms 3D points from the world to the camera coordinate space. |
| 206 | /// Left-handed coordinate system, y up, z forward. |
| 207 | pub world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/Matrix4x4#>, |
| 208 | |
| 209 | /// The matrix that transforms 3D points from the world to the "Normalized Device Coordinate" space. |
| 210 | /// Left-handed coordinate system, y up, z forward. |
| 211 | pub world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/Matrix4x4#>, |
| 212 | |
| 213 | /// Specifies whether the pixels in a deep image are sorted and non-overlapping. |
| 214 | pub deep_image_staterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#deep_image_state.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/Rational#>, |
| 215 | |
| 216 | /// If the image was cropped, contains the original data window. |
| 217 | pub original_data_windowrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#original_data_window.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#>, |
| 218 | |
| 219 | /// An 8-bit rgba image representing the rendered image. |
| 220 | pub previewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#preview.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Previewrust-analyzer cargo exr 1.74.0 meta/attribute/Preview#>, |
| 221 | |
| 222 | /// Name of the view, which is typically either `"right"` or `"left"` for a stereoscopic image. |
| 223 | pub view_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#view_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 224 | |
| 225 | /// The name of the software that produced this image. |
| 226 | pub software_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#software_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>, |
| 227 | |
| 228 | /// The near clip plane of the virtual camera projection. |
| 229 | pub near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 230 | |
| 231 | /// The far clip plane of the virtual camera projection. |
| 232 | pub far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 233 | |
| 234 | /// The field of view angle, along the horizontal axis, in degrees. |
| 235 | pub horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 236 | |
| 237 | /// The field of view angle, along the horizontal axis, in degrees. |
| 238 | pub vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 239 | |
| 240 | /// Contains custom attributes. |
| 241 | /// Does not contain the attributes already present in the `Header` or `LayerAttributes` struct. |
| 242 | /// Does not contain attributes that are standardized to be the same for all layers: no chromaticities and no time codes. |
| 243 | pub otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other.: HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#>, |
| 244 | } |
| 245 | |
| 246 | |
| 247 | impl LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes# { |
| 248 | |
| 249 | /// Create default layer attributes with a data position of zero. |
| 250 | pub fn namedrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes]named().(layer_name: impl Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#>) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] { |
| 251 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] { |
| 252 | layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(layer_name.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().()), |
| 253 | .. Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes]::defaultrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default]default().() |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | /// Set the data position of this layer. |
| 258 | pub fn with_positionrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes]with_position().(self, data_position: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<i32>) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] { |
| 259 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] { layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position.: data_position, ..self } |
| 260 | } |
| 261 | |
| 262 | /// Set all common camera projection attributes at once. |
| 263 | pub fn with_camera_frustumrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes]with_camera_frustum().( |
| 264 | self, |
| 265 | world_to_camera: Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/Matrix4x4#, |
| 266 | world_to_normalized_device: Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/Matrix4x4#, |
| 267 | field_of_view: impl Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<f32>>, |
| 268 | depth_clip_range: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<f32>, |
| 269 | ) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] |
| 270 | { |
| 271 | let fov = field_of_view.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().(); |
| 272 | |
| 273 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes] { |
| 274 | world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(world_to_normalized_device), |
| 275 | world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(world_to_camera), |
| 276 | horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(fov.xrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]x().()), |
| 277 | vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(fov.yrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]y().()), |
| 278 | near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(depth_clip_range.startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#start.), |
| 279 | far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(depth_clip_range.endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#end.), |
| 280 | ..self |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | impl ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes# { |
| 286 | |
| 287 | /// Set the display position and size of this image. |
| 288 | pub fn newrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]new().(display_window: IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes] { |
| 289 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes] { |
| 290 | pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect.: 1.0, |
| 291 | chromaticitiesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#chromaticities.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 292 | time_coderust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#time_code.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 293 | otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other.: Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default#::defaultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`][Default]default().(), |
| 294 | display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window., |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | /// Set the display position to zero and use the specified size for this image. |
| 299 | pub fn with_sizerust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]with_size().(size: impl Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>>) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes] { |
| 300 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]::newrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]new().(IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#::from_dimensionsrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]from_dimensions().(size)) |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | impl Headerrust-analyzer cargo exr 1.74.0 meta/header/Header# { |
| 308 | |
| 309 | /// Create a new Header with the specified name, display window and channels. |
| 310 | /// Use `Header::with_encoding` and the similar methods to add further properties to the header. |
| 311 | /// |
| 312 | /// The other settings are left to their default values: |
| 313 | /// - RLE compression |
| 314 | /// - display window equal to data window |
| 315 | /// - tiles (64 x 64 px) |
| 316 | /// - unspecified line order |
| 317 | /// - no custom attributes |
| 318 | pub fn newrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]new().(name: Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#, data_size: impl Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>>, channels: SmallVecrust-analyzer cargo smallvec 1.15.1 SmallVec#<[ChannelDescriptionrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelDescription#; 5]>) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 319 | let data_size: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize> = data_size.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().(); |
| 320 | |
| 321 | let compression = Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::RLErust-analyzer cargo exr 1.74.0 compression/Compression#RLE#; |
| 322 | let blocks = BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(TileDescriptionrust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription# { |
| 323 | tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(64, 64), |
| 324 | level_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#level_mode.: LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::Singularrust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#Singular#, |
| 325 | rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode.: RoundingModerust-analyzer cargo exr 1.74.0 math/RoundingMode#::Downrust-analyzer cargo exr 1.74.0 math/RoundingMode#Down# |
| 326 | }); |
| 327 | |
| 328 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 329 | layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.: data_size, |
| 330 | compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression., |
| 331 | blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks., |
| 332 | |
| 333 | channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels.: ChannelListrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelList#::newrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[ChannelList]new().(channels), |
| 334 | line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order.: LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#::Unspecifiedrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#Unspecified#, |
| 335 | |
| 336 | shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes.: ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#::with_sizerust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]with_size().(data_size), |
| 337 | own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes.: LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#::namedrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes]named().(name), |
| 338 | |
| 339 | chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count.: compute_chunk_countrust-analyzer cargo exr 1.74.0 meta/compute_chunk_count().(compression, data_size, blocks), |
| 340 | |
| 341 | deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep.: false, |
| 342 | deep_data_versionrust-analyzer cargo exr 1.74.0 meta/header/Header#deep_data_version.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 343 | max_samples_per_pixelrust-analyzer cargo exr 1.74.0 meta/header/Header#max_samples_per_pixel.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | /// Set the display window, that is, the global clipping rectangle. |
| 348 | /// __Must be the same for all headers of a file.__ |
| 349 | pub fn with_display_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]with_display_window().(mut self, display_window: IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 350 | self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window. = display_window; |
| 351 | self |
| 352 | } |
| 353 | |
| 354 | /// Set the offset of this layer. |
| 355 | pub fn with_positionrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]with_position().(mut self, position: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<i32>) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 356 | self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position. = position; |
| 357 | self |
| 358 | } |
| 359 | |
| 360 | /// Set compression, tiling, and line order. Automatically computes chunk count. |
| 361 | pub fn with_encodingrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]with_encoding().(self, compression: Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#, blocks: BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#, line_order: LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 362 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 363 | chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count.: compute_chunk_countrust-analyzer cargo exr 1.74.0 meta/compute_chunk_count().(compression, self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size., blocks), |
| 364 | compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression., blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks., line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order., |
| 365 | .. self |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | /// Set **all** attributes of the header that are not shared with all other headers in the image. |
| 370 | pub fn with_attributesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]with_attributes().(self, own_attributes: LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 371 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes., .. self } |
| 372 | } |
| 373 | |
| 374 | /// Set **all** attributes of the header that are shared with all other headers in the image. |
| 375 | pub fn with_shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]with_shared_attributes().(self, shared_attributes: ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#) -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { |
| 376 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header] { shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes., .. self } |
| 377 | } |
| 378 | |
| 379 | /// Iterate over all blocks, in the order specified by the headers line order attribute. |
| 380 | /// Unspecified line order is treated as increasing line order. |
| 381 | /// Also enumerates the index of each block in the header, as if it were sorted in increasing line order. |
| 382 | pub fn enumerate_ordered_blocksrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]enumerate_ordered_blocks().(&self) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(usize, TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices#)> + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# { |
| 383 | let increasing_y = self.blocks_increasing_y_orderrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]blocks_increasing_y_order().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().(); |
| 384 | |
| 385 | // TODO without box? |
| 386 | let ordered: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(usize, TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices#)>> = { |
| 387 | if self.line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order. rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq().LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#::Decreasingrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#Decreasing# { Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(increasing_y.revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().()) } |
| 388 | else { Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(increasing_y) } |
| 389 | }; |
| 390 | |
| 391 | ordered |
| 392 | } |
| 393 | |
| 394 | /*/// Iterate over all blocks, in the order specified by the headers line order attribute. |
| 395 | /// Also includes an index of the block if it were `LineOrder::Increasing`, starting at zero for this header. |
| 396 | pub fn enumerate_ordered_blocks(&self) -> impl Iterator<Item = (usize, TileIndices)> + Send { |
| 397 | let increasing_y = self.blocks_increasing_y_order().enumerate(); |
| 398 | |
| 399 | let ordered: Box<dyn Send + Iterator<Item = (usize, TileIndices)>> = { |
| 400 | if self.line_order == LineOrder::Decreasing { |
| 401 | Box::new(increasing_y.rev()) // TODO without box? |
| 402 | } |
| 403 | else { |
| 404 | Box::new(increasing_y) |
| 405 | } |
| 406 | }; |
| 407 | |
| 408 | ordered |
| 409 | }*/ |
| 410 | |
| 411 | /// Iterate over all tile indices in this header in `LineOrder::Increasing` order. |
| 412 | pub fn blocks_increasing_y_orderrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]blocks_increasing_y_order().(&self) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices#> + ExactSizeIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/exact_size/ExactSizeIterator# + DoubleEndedIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/double_ended/DoubleEndedIterator# { |
| 413 | fn tiles_ofrust-analyzer cargo exr 1.74.0 meta/header/tiles_of().(image_size: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>, tile_size: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>, level_index: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices#> { |
| 414 | fn divide_and_restrust-analyzer cargo exr 1.74.0 meta/header/divide_and_rest().(total_size: usize, block_size: usize) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(usize, usize)> { |
| 415 | let block_count = compute_block_countrust-analyzer cargo exr 1.74.0 meta/compute_block_count().(total_size, block_size); |
| 416 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#block_count).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(move |block_index| ( |
| 417 | block_index, calculate_block_sizerust-analyzer cargo exr 1.74.0 meta/calculate_block_size().(total_size, block_size, block_index).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("block size calculation bug") |
| 418 | )) |
| 419 | } |
| 420 | |
| 421 | divide_and_restrust-analyzer cargo exr 1.74.0 meta/header/divide_and_rest().(image_size.heightrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]height().(), tile_size.heightrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]height().()).flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(move |(y_index, tile_height)|{ |
| 422 | divide_and_restrust-analyzer cargo exr 1.74.0 meta/header/divide_and_rest().(image_size.widthrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]width().(), tile_size.widthrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]width().()).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(move |(x_index, tile_width)|{ |
| 423 | TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices# { |
| 424 | sizerust-analyzer cargo exr 1.74.0 meta/TileIndices#size.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(tile_width, tile_height), |
| 425 | locationrust-analyzer cargo exr 1.74.0 meta/TileIndices#location.: TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates# { tile_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#tile_index.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(x_index, y_index), level_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#level_index., }, |
| 426 | } |
| 427 | }) |
| 428 | }) |
| 429 | } |
| 430 | |
| 431 | let vec: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<TileIndicesrust-analyzer cargo exr 1.74.0 meta/TileIndices#> = { |
| 432 | if let BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles) = self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 433 | match tiles.level_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#level_mode. { |
| 434 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::Singularrust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#Singular# => { |
| 435 | tiles_ofrust-analyzer cargo exr 1.74.0 meta/header/tiles_of().(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size., tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size., Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0)).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 436 | }, |
| 437 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::MipMaprust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#MipMap# => { |
| 438 | mip_map_levelsrust-analyzer cargo exr 1.74.0 meta/mip_map_levels().(tiles.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.) |
| 439 | .flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(move |(level_index, level_size)|{ |
| 440 | tiles_ofrust-analyzer cargo exr 1.74.0 meta/header/tiles_of().(level_size, tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size., Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(level_index, level_index)) |
| 441 | }) |
| 442 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 443 | }, |
| 444 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::RipMaprust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#RipMap# => { |
| 445 | rip_map_levelsrust-analyzer cargo exr 1.74.0 meta/rip_map_levels().(tiles.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.) |
| 446 | .flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(move |(level_index, level_size)| { |
| 447 | tiles_ofrust-analyzer cargo exr 1.74.0 meta/header/tiles_of().(level_size, tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size., level_index) |
| 448 | }) |
| 449 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 450 | } |
| 451 | } |
| 452 | } |
| 453 | else { |
| 454 | let tiles = Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size..0rust-analyzer cargo exr 1.74.0 math/Vec2#0., self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().()); |
| 455 | tiles_ofrust-analyzer cargo exr 1.74.0 meta/header/tiles_of().(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size., tiles, Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0)).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 456 | } |
| 457 | }; |
| 458 | |
| 459 | vec.into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().() // TODO without collect |
| 460 | } |
| 461 | |
| 462 | /* TODO |
| 463 | /// The block indices of this header, ordered as they would appear in the file. |
| 464 | pub fn ordered_block_indices<'s>(&'s self, layer_index: usize) -> impl 's + Iterator<Item=BlockIndex> { |
| 465 | self.enumerate_ordered_blocks().map(|(chunk_index, tile)|{ |
| 466 | let data_indices = self.get_absolute_block_pixel_coordinates(tile.location).expect("tile coordinate bug"); |
| 467 | |
| 468 | BlockIndex { |
| 469 | layer: layer_index, |
| 470 | level: tile.location.level_index, |
| 471 | pixel_position: data_indices.position.to_usize("data indices start").expect("data index bug"), |
| 472 | pixel_size: data_indices.size, |
| 473 | } |
| 474 | }) |
| 475 | }*/ |
| 476 | |
| 477 | // TODO reuse this function everywhere |
| 478 | /// The default pixel resolution of a single block (tile or scan line block). |
| 479 | /// Not all blocks have this size, because they may be cutoff at the end of the image. |
| 480 | pub fn max_block_pixel_sizerust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]max_block_pixel_size().(&self) -> Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize> { |
| 481 | match self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 482 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines# => Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size..0rust-analyzer cargo exr 1.74.0 math/Vec2#0., self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().()), |
| 483 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles) => tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size., |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | /// Calculate the position of a block in the global infinite 2D space of a file. May be negative. |
| 488 | pub fn get_block_data_window_pixel_coordinatesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]get_block_data_window_pixel_coordinates().(&self, tile: TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#> { |
| 489 | let data = self.get_absolute_block_pixel_coordinatesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]get_absolute_block_pixel_coordinates().(tile)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 490 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(data.with_originrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]with_origin().(self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position.)) |
| 491 | } |
| 492 | |
| 493 | /// Calculate the pixel index rectangle inside this header. Is not negative. Starts at `0`. |
| 494 | pub fn get_absolute_block_pixel_coordinatesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]get_absolute_block_pixel_coordinates().(&self, tile: TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#> { |
| 495 | if let BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles) = self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 496 | let Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(data_width, data_height) = self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.; |
| 497 | |
| 498 | let data_width = compute_level_sizerust-analyzer cargo exr 1.74.0 meta/compute_level_size().(tiles.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., data_width, tile.level_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#level_index..xrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]x().()); |
| 499 | let data_height = compute_level_sizerust-analyzer cargo exr 1.74.0 meta/compute_level_size().(tiles.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., data_height, tile.level_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#level_index..yrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]y().()); |
| 500 | let absolute_tile_coordinates = tile.to_data_indicesrust-analyzer cargo exr 1.74.0 block/chunk/impl#[TileCoordinates]to_data_indices().(tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size., Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(data_width, data_height))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 501 | |
| 502 | if absolute_tile_coordinates.positionrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#position..xrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]x().() as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().data_width as i64 || absolute_tile_coordinates.positionrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#position..yrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]y().() as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().data_height as i64 { |
| 503 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("data block tile index")) |
| 504 | } |
| 505 | |
| 506 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(absolute_tile_coordinates) |
| 507 | } |
| 508 | else { // this is a scanline image |
| 509 | debug_assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert_eq!!(tile.tile_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#tile_index..0rust-analyzer cargo exr 1.74.0 math/Vec2#0., 0, "block index calculation bug"); |
| 510 | |
| 511 | let (y, height) = calculate_block_position_and_sizerust-analyzer cargo exr 1.74.0 meta/calculate_block_position_and_size().( |
| 512 | self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size..heightrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]height().(), |
| 513 | self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().(), |
| 514 | tile.tile_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#tile_index..yrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]y().() |
| 515 | )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 516 | |
| 517 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds# { |
| 518 | positionrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#position.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, usize_to_i32rust-analyzer cargo exr 1.74.0 error/usize_to_i32().(y, "tile y")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().), |
| 519 | sizerust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#size.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size..widthrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]width().(), height) |
| 520 | }) |
| 521 | } |
| 522 | |
| 523 | // TODO deep data? |
| 524 | } |
| 525 | |
| 526 | /// Return the tile index, converting scan line block coordinates to tile indices. |
| 527 | /// Starts at `0` and is not negative. |
| 528 | pub fn get_block_data_indicesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]get_block_data_indices().(&self, block: &CompressedBlockrust-analyzer cargo exr 1.74.0 block/chunk/CompressedBlock#) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#> { |
| 529 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match block { |
| 530 | CompressedBlockrust-analyzer cargo exr 1.74.0 block/chunk/CompressedBlock#::Tilerust-analyzer cargo exr 1.74.0 block/chunk/CompressedBlock#Tile#(ref tile) => { |
| 531 | tile.coordinatesrust-analyzer cargo exr 1.74.0 block/chunk/CompressedTileBlock#coordinates. |
| 532 | }, |
| 533 | |
| 534 | CompressedBlockrust-analyzer cargo exr 1.74.0 block/chunk/CompressedBlock#::ScanLinerust-analyzer cargo exr 1.74.0 block/chunk/CompressedBlock#ScanLine#(ref block) => { |
| 535 | let size = self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().() as i32; |
| 536 | |
| 537 | let diff = block.y_coordinaterust-analyzer cargo exr 1.74.0 block/chunk/CompressedScanLineBlock#y_coordinate..checked_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]checked_sub().(self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position..yrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]y().()).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("invalid header"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 538 | let y = diff.checked_divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]checked_div().(size).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("invalid header"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 539 | |
| 540 | if y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 541 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("scan block y coordinate")); |
| 542 | } |
| 543 | |
| 544 | TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates# { |
| 545 | tile_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#tile_index.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, y as usize), |
| 546 | level_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#level_index.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0) |
| 547 | } |
| 548 | }, |
| 549 | |
| 550 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::unsupportedrust-analyzer cargo exr 1.74.0 error/impl#[Error]unsupported().("deep data not supported yet")) |
| 551 | }) |
| 552 | } |
| 553 | |
| 554 | /// Computes the absolute tile coordinate data indices, which start at `0`. |
| 555 | pub fn get_scan_line_block_tile_coordinatesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]get_scan_line_block_tile_coordinates().(&self, block_y_coordinate: i32) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#> { |
| 556 | let size = self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().() as i32; |
| 557 | |
| 558 | let diff = block_y_coordinate.checked_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]checked_sub().(self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position..1rust-analyzer cargo exr 1.74.0 math/Vec2#1.).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("invalid header"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 559 | let y = diff.checked_divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]checked_div().(size).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("invalid header"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 560 | |
| 561 | if y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 562 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("scan block y coordinate")); |
| 563 | } |
| 564 | |
| 565 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TileCoordinatesrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates# { |
| 566 | tile_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#tile_index.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, y as usize), |
| 567 | level_indexrust-analyzer cargo exr 1.74.0 block/chunk/TileCoordinates#level_index.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0) |
| 568 | }) |
| 569 | } |
| 570 | |
| 571 | /// Maximum byte length of an uncompressed or compressed block, used for validation. |
| 572 | pub fn max_block_byte_sizerust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]max_block_byte_size().(&self) -> usize { |
| 573 | self.channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels..bytes_per_pixelrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelList#bytes_per_pixel. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().match self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 574 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles) => tiles.tile_sizerust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#tile_size..arearust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]area().(), |
| 575 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines# => self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..scan_lines_per_blockrust-analyzer cargo exr 1.74.0 compression/impl#[Compression]scan_lines_per_block().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size..widthrust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]width().() |
| 576 | // TODO What about deep data??? |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | /// Returns the number of bytes that the pixels of this header will require |
| 581 | /// when stored without compression. Respects multi-resolution levels and subsampling. |
| 582 | pub fn total_pixel_bytesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]total_pixel_bytes().(&self) -> usize { |
| 583 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep.); |
| 584 | |
| 585 | let pixel_count_of_levels = |size: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#<usize>| -> usize { |
| 586 | match self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 587 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines# => size.arearust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]area().(), |
| 588 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tile_description) => match tile_description.level_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#level_mode. { |
| 589 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::Singularrust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#Singular# => size.arearust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]area().(), |
| 590 | |
| 591 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::MipMaprust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#MipMap# => mip_map_levelsrust-analyzer cargo exr 1.74.0 meta/mip_map_levels().(tile_description.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., size) |
| 592 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(_, size)| size.arearust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]area().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().(), |
| 593 | |
| 594 | LevelModerust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#::RipMaprust-analyzer cargo exr 1.74.0 meta/attribute/LevelMode#RipMap# => rip_map_levelsrust-analyzer cargo exr 1.74.0 meta/rip_map_levels().(tile_description.rounding_moderust-analyzer cargo exr 1.74.0 meta/attribute/TileDescription#rounding_mode., size) |
| 595 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(_, size)| size.arearust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`]area().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().(), |
| 596 | } |
| 597 | } |
| 598 | }; |
| 599 | |
| 600 | self.channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels..listrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelList#list..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 601 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|channel: &ChannelDescriptionrust-analyzer cargo exr 1.74.0 meta/attribute/ChannelDescription#| |
| 602 | pixel_count_of_levels(channel.subsampled_resolutionrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[ChannelDescription]subsampled_resolution().(self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.)) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().channel.sample_typerust-analyzer cargo exr 1.74.0 meta/attribute/ChannelDescription#sample_type..bytes_per_samplerust-analyzer cargo exr 1.74.0 meta/attribute/impl#[SampleType]bytes_per_sample().() |
| 603 | ) |
| 604 | .sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().() |
| 605 | |
| 606 | } |
| 607 | |
| 608 | /// Approximates the maximum number of bytes that the pixels of this header will consume in a file. |
| 609 | /// Due to compression, the actual byte size may be smaller. |
| 610 | pub fn max_pixel_file_bytesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]max_pixel_file_bytes().(&self) -> usize { |
| 611 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep.); |
| 612 | |
| 613 | self.chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().// at most 64 bytes overhead for each chunk (header index, tile description, chunk size, and more)rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). |
| 614 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.total_pixel_bytesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]total_pixel_bytes().() |
| 615 | } |
| 616 | |
| 617 | /// Validate this instance. |
| 618 | pub fn validaterust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]validate().(&self, is_multilayer: bool, long_names: &mut bool, strict: bool) -> UnitResultrust-analyzer cargo exr 1.74.0 error/UnitResult# { |
| 619 | |
| 620 | self.data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().().validaterust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]validate().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 621 | self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window..validaterust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]validate().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 622 | |
| 623 | if strict { |
| 624 | if is_multilayer { |
| 625 | if self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 626 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("layer name for multi layer file")); |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | if self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq().BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines# && self.line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order. rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 meta/attribute/impl#[LineOrder][`PartialEq<Self>`]eq().LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#::Unspecifiedrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#Unspecified# { |
| 631 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("unspecified line order in scan line images")); |
| 632 | } |
| 633 | |
| 634 | if self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size. rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq().Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0) { |
| 635 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("empty data window")); |
| 636 | } |
| 637 | |
| 638 | if self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window..sizerust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#size. rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 math/impl#[`Vec2<T>`][`PartialEq<Self>`]eq().Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0,0) { |
| 639 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("empty display window")); |
| 640 | } |
| 641 | |
| 642 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect..is_normalrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]is_normal().() || self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt().1.0e-6 || self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]gt().1.0e6 { |
| 643 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("pixel aspect ratio")); |
| 644 | } |
| 645 | |
| 646 | if self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]lt().0.0 { |
| 647 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("screen window width")); |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | let allow_subsampling = !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep. && self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq().==rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq(). rust-analyzer cargo exr 1.74.0 meta/impl#[BlockDescription][`PartialEq<Self>`]eq().BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines#; |
| 652 | self.channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels..validaterust-analyzer cargo exr 1.74.0 meta/attribute/impl#[ChannelList]validate().(allow_subsampling, self.data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().(), strict)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 653 | |
| 654 | for (name, value) in &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other. { |
| 655 | attributerust-analyzer cargo exr 1.74.0 meta/attribute/::validaterust-analyzer cargo exr 1.74.0 meta/attribute/validate().(name, value, long_names, allow_subsampling, self.data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().(), strict)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 656 | } |
| 657 | |
| 658 | for (name, value) in &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other. { |
| 659 | attributerust-analyzer cargo exr 1.74.0 meta/attribute/::validaterust-analyzer cargo exr 1.74.0 meta/attribute/validate().(name, value, long_names, allow_subsampling, self.data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().(), strict)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 660 | } |
| 661 | |
| 662 | // this is only to check whether someone tampered with our precious values, to avoid writing an invalid file |
| 663 | if self.chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().compute_chunk_countrust-analyzer cargo exr 1.74.0 meta/compute_chunk_count().(self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression., self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size., self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks.) { |
| 664 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("chunk count attribute")); // TODO this may be an expensive check? |
| 665 | } |
| 666 | |
| 667 | // check if attribute names appear twice |
| 668 | if strict { |
| 669 | for (name, _) in &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other. { |
| 670 | if self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other..contains_keyrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]contains_key().(name) { |
| 671 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("duplicate attribute name: `{}`", name))); |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | for &reserved in headerrust-analyzer cargo exr 1.74.0 meta/header/::standard_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ALLrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ALL..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() { |
| 676 | let name = Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#::from_bytes_uncheckedrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[Text]from_bytes_unchecked().(SmallVecrust-analyzer cargo smallvec 1.15.1 SmallVec#::from_slicerust-analyzer cargo smallvec 1.15.1 impl#[`SmallVec<A>`]from_slice().(reserved)); |
| 677 | if self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other..contains_keyrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]contains_key().(&name) || self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other..contains_keyrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]contains_key().(&name) { |
| 678 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 679 | "attribute name `{}` is reserved and cannot be custom", |
| 680 | Textrust-analyzer cargo exr 1.74.0 meta/attribute/Text#::from_bytes_uncheckedrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[Text]from_bytes_unchecked().(reserved.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 681 | ))); |
| 682 | } |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | if self.deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep. { |
| 687 | if strict { |
| 688 | if self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 689 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("layer name for deep file")); |
| 690 | } |
| 691 | |
| 692 | if self.max_samples_per_pixelrust-analyzer cargo exr 1.74.0 meta/header/Header#max_samples_per_pixel..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 693 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("missing max samples per pixel attribute for deepdata")); |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | match self.deep_data_versionrust-analyzer cargo exr 1.74.0 meta/header/Header#deep_data_version. { |
| 698 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1) => {}, |
| 699 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::unsupportedrust-analyzer cargo exr 1.74.0 error/impl#[Error]unsupported().("deep data version")), |
| 700 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("deep data version")), |
| 701 | } |
| 702 | |
| 703 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression..supports_deep_datarust-analyzer cargo exr 1.74.0 compression/impl#[Compression]supports_deep_data().() { |
| 704 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("compression method does not support deep data")); |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 709 | } |
| 710 | |
| 711 | /// Read the headers without validating them. |
| 712 | pub fn read_allrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]read_all().(read: &mut PeekReadrust-analyzer cargo exr 1.74.0 io/PeekRead#<impl Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#>, version: &Requirementsrust-analyzer cargo exr 1.74.0 meta/Requirements#, pedantic: bool) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<Headersrust-analyzer cargo exr 1.74.0 meta/Headers#> { |
| 713 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().version.is_multilayerrust-analyzer cargo exr 1.74.0 meta/impl#[Requirements]is_multilayer().() { |
| 714 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(smallvecrust-analyzer cargo smallvec 1.15.1 smallvec!![ Headerrust-analyzer cargo exr 1.74.0 meta/header/Header#::readrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]read().(read, version, pedantic)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). ]) |
| 715 | } |
| 716 | else { |
| 717 | let mut headers = SmallVecrust-analyzer cargo smallvec 1.15.1 SmallVec#::newrust-analyzer cargo smallvec 1.15.1 impl#[`SmallVec<A>`]new().(); |
| 718 | |
| 719 | while !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().sequence_endrust-analyzer cargo exr 1.74.0 meta/sequence_end/::has_comerust-analyzer cargo exr 1.74.0 meta/sequence_end/has_come().(read)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 720 | headers.pushrust-analyzer cargo smallvec 1.15.1 impl#[`SmallVec<A>`]push().(Headerrust-analyzer cargo exr 1.74.0 meta/header/Header#::readrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]read().(read, version, pedantic)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().); |
| 721 | } |
| 722 | |
| 723 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(headers) |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | /// Without validation, write the headers to the byte stream. |
| 728 | pub fn write_allrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]write_all().(headers: &[Headerrust-analyzer cargo exr 1.74.0 meta/header/Header#], write: &mut impl Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#, is_multilayer: bool) -> UnitResultrust-analyzer cargo exr 1.74.0 error/UnitResult# { |
| 729 | for header in headers { |
| 730 | header.writerust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]write().(write)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 731 | } |
| 732 | |
| 733 | if is_multilayer { |
| 734 | sequence_endrust-analyzer cargo exr 1.74.0 meta/sequence_end/::writerust-analyzer cargo exr 1.74.0 meta/sequence_end/write().(write)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 735 | } |
| 736 | |
| 737 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 738 | } |
| 739 | |
| 740 | /// Iterate over all `(name, attribute_value)` pairs in this header that would be written to a file. |
| 741 | /// The order of attributes is arbitrary and may change in future versions. |
| 742 | /// Will always contain all strictly required attributes, such as channels, compression, data window, and similar. |
| 743 | /// Hint: Use `attribute.kind_name()` to obtain the standardized name of the attribute type. |
| 744 | /// Does not validate the header or attributes. |
| 745 | // This function is used for writing the attributes to files. |
| 746 | #[inline] |
| 747 | pub fn all_named_attributesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]all_named_attributes().(&self) -> impl '_ + Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(&TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#)> { |
| 748 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::{oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once/once()., once_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once_with/once_with()., emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/empty/empty().}; |
| 749 | use craterust-analyzer cargo exr 1.74.0 crate/::metarust-analyzer cargo exr 1.74.0 meta/::headerrust-analyzer cargo exr 1.74.0 meta/header/::standard_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/::*; |
| 750 | use AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#::*; |
| 751 | |
| 752 | #[inline] fn optionalrust-analyzer cargo exr 1.74.0 meta/header/optional().<'t, T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#>( |
| 753 | name: &'t TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, |
| 754 | to_attribute: impl Fnrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/Fn#(T) -> AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#, |
| 755 | value: &'t Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T> |
| 756 | ) |
| 757 | -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(&'t TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#)> |
| 758 | { |
| 759 | value.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(move |value| (name, to_attribute(value.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()))).into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][IntoIterator]into_iter().() |
| 760 | } |
| 761 | |
| 762 | #[inline] fn requiredrust-analyzer cargo exr 1.74.0 meta/header/required().<'s, T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#>(name: &'s TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, to_attribute: impl Fnrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/Fn#(T) -> AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#, value: &'s T) |
| 763 | -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(&'s TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#)> |
| 764 | { |
| 765 | oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once/once().((name, to_attribute((*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().value).clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()))) |
| 766 | } |
| 767 | |
| 768 | // used to type-check local variables. only requried because you cannot do `let i: impl Iterator<> = ...` |
| 769 | #[inline] fn expect_is_iterrust-analyzer cargo exr 1.74.0 meta/header/expect_is_iter().<'s, T: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item#=(&'s TextSlicerust-analyzer cargo exr 1.74.0 meta/attribute/TextSlice#, AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#)>>(val: T) -> T { val } |
| 770 | |
| 771 | macro_rules! iter_allrust-analyzer cargo exr 1.74.0 meta/header/iter_all! { |
| 772 | ( $( $value:expr ),* ) => { |
| 773 | empty() $( .chain( $value ) )* |
| 774 | }; |
| 775 | } |
| 776 | |
| 777 | macro_rules! required_attributesrust-analyzer cargo exr 1.74.0 meta/header/required_attributes! { |
| 778 | ( $($name: ident : $variant: ident = $value: expr),* ) => { |
| 779 | expect_is_iter(iter_all!( |
| 780 | $( required($name, $variant, $value) ),* |
| 781 | )) |
| 782 | }; |
| 783 | } |
| 784 | |
| 785 | macro_rules! optional_attributesrust-analyzer cargo exr 1.74.0 meta/header/optional_attributes! { |
| 786 | ( $($name: ident : $variant: ident = $value: expr),* ) => { |
| 787 | expect_is_iter(iter_all!( |
| 788 | $( optional($name, $variant, $value) ),* |
| 789 | )) |
| 790 | }; |
| 791 | } |
| 792 | |
| 793 | #[inline] fn usize_as_i32rust-analyzer cargo exr 1.74.0 meta/header/usize_as_i32().(value: usize) -> AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue# { |
| 794 | I32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#I32#(i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[i32][`TryFrom<usize>`]try_from().(value).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("usize exceeds i32 range")) |
| 795 | } |
| 796 | |
| 797 | |
| 798 | let block_type_and_tiles = expect_is_iterrust-analyzer cargo exr 1.74.0 meta/header/expect_is_iter().(once_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once_with/once_with().(move ||{ |
| 799 | let (block_type, tiles) = match self.blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks. { |
| 800 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines# => (attributerust-analyzer cargo exr 1.74.0 meta/attribute/::BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::ScanLinerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#ScanLine#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 801 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles) => (attributerust-analyzer cargo exr 1.74.0 meta/attribute/::BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::Tilerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#Tile#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(tiles)) |
| 802 | }; |
| 803 | |
| 804 | oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once/once().((BLOCK_TYPErust-analyzer cargo exr 1.74.0 meta/header/standard_names/BLOCK_TYPE., BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#BlockType#(block_type))) |
| 805 | .chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(tiles.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|tiles| (TILESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/TILES., TileDescriptionrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TileDescription#(tiles)))) |
| 806 | }).flattenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flatten().()); |
| 807 | |
| 808 | let data_window = expect_is_iterrust-analyzer cargo exr 1.74.0 meta/header/expect_is_iter().(once_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once_with/once_with().(move ||{ |
| 809 | (DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DATA_WINDOW., IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds#(self.data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().())) |
| 810 | })); |
| 811 | |
| 812 | // dwa writes compression parameters as attribute. |
| 813 | let dwa_compr_level = expect_is_iterrust-analyzer cargo exr 1.74.0 meta/header/expect_is_iter().( |
| 814 | once_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/once_with/once_with().(move ||{ |
| 815 | match self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression. { |
| 816 | attributerust-analyzer cargo exr 1.74.0 meta/attribute/::Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWAArust-analyzer cargo exr 1.74.0 compression/Compression#DWAA#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level)) | |
| 817 | attributerust-analyzer cargo exr 1.74.0 meta/attribute/::Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWABrust-analyzer cargo exr 1.74.0 compression/Compression#DWAB#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level)) => |
| 818 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((DWA_COMPRESSION_LEVELrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DWA_COMPRESSION_LEVEL., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(level))), |
| 819 | |
| 820 | _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 821 | } |
| 822 | }).flattenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flatten().() |
| 823 | ); |
| 824 | |
| 825 | let opt_core_attrs = optional_attributesrust-analyzer cargo exr 1.74.0 meta/header/optional_attributes!!( |
| 826 | DEEP_DATA_VERSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_DATA_VERSION.: I32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#I32# = &self.deep_data_versionrust-analyzer cargo exr 1.74.0 meta/header/Header#deep_data_version., |
| 827 | MAX_SAMPLESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MAX_SAMPLES.: usize_as_i32rust-analyzer cargo exr 1.74.0 meta/header/usize_as_i32(). = &self.max_samples_per_pixelrust-analyzer cargo exr 1.74.0 meta/header/Header#max_samples_per_pixel. |
| 828 | ).chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(block_type_and_tiles).chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(dwa_compr_level); |
| 829 | |
| 830 | let req_core_attrs = required_attributesrust-analyzer cargo exr 1.74.0 meta/header/required_attributes!!( |
| 831 | // chunks is not actually required, but always computed in this library anyways |
| 832 | CHUNKSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHUNKS.: usize_as_i32rust-analyzer cargo exr 1.74.0 meta/header/usize_as_i32(). = &self.chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count., |
| 833 | |
| 834 | CHANNELSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHANNELS.: ChannelListrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#ChannelList# = &self.channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels., |
| 835 | COMPRESSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMPRESSION.: Compressionrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Compression# = &self.compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression., |
| 836 | LINE_ORDERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LINE_ORDER.: LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#LineOrder# = &self.line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order., |
| 837 | |
| 838 | DISPLAY_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DISPLAY_WINDOW.: IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds# = &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window., |
| 839 | PIXEL_ASPECTrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PIXEL_ASPECT.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect., |
| 840 | |
| 841 | WINDOW_CENTERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_CENTER.: FloatVec2rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#FloatVec2# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..screen_window_centerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_center., |
| 842 | WINDOW_WIDTHrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_WIDTH.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width. |
| 843 | ).chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(data_window); |
| 844 | |
| 845 | let opt_attr = optional_attributesrust-analyzer cargo exr 1.74.0 meta/header/optional_attributes!!( |
| 846 | NAMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/NAME.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name., |
| 847 | WHITE_LUMINANCErust-analyzer cargo exr 1.74.0 meta/header/standard_names/WHITE_LUMINANCE.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..white_luminancerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#white_luminance., |
| 848 | ADOPTED_NEUTRALrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ADOPTED_NEUTRAL.: FloatVec2rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#FloatVec2# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..adopted_neutralrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#adopted_neutral., |
| 849 | RENDERING_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/RENDERING_TRANSFORM.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..rendering_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#rendering_transform_name., |
| 850 | LOOK_MOD_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LOOK_MOD_TRANSFORM.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..look_modification_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#look_modification_transform_name., |
| 851 | X_DENSITYrust-analyzer cargo exr 1.74.0 meta/header/standard_names/X_DENSITY.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..horizontal_densityrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_density., |
| 852 | OWNERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/OWNER.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..ownerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#owner., |
| 853 | COMMENTSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMMENTS.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..commentsrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#comments., |
| 854 | CAPTURE_DATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/CAPTURE_DATE.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..capture_daterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#capture_date., |
| 855 | UTC_OFFSETrust-analyzer cargo exr 1.74.0 meta/header/standard_names/UTC_OFFSET.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..utc_offsetrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#utc_offset., |
| 856 | LONGITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LONGITUDE.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..longituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#longitude., |
| 857 | LATITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LATITUDE.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..latituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#latitude., |
| 858 | ALTITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/ALTITUDE.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..altituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#altitude., |
| 859 | FOCUSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOCUS.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..focusrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#focus., |
| 860 | EXPOSURE_TIMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/EXPOSURE_TIME.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..exposurerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#exposure., |
| 861 | APERTURErust-analyzer cargo exr 1.74.0 meta/header/standard_names/APERTURE.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..aperturerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#aperture., |
| 862 | ISO_SPEEDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ISO_SPEED.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..iso_speedrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#iso_speed., |
| 863 | ENVIRONMENT_MAPrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ENVIRONMENT_MAP.: EnvironmentMaprust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#EnvironmentMap# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..environment_maprust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#environment_map., |
| 864 | KEY_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/KEY_CODE.: KeyCoderust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#KeyCode# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..film_key_coderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#film_key_code., |
| 865 | TIME_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/TIME_CODE.: TimeCoderust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TimeCode# = &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..time_coderust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#time_code., |
| 866 | WRAP_MODESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WRAP_MODES.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..wrap_mode_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#wrap_mode_name., |
| 867 | FRAMES_PER_SECONDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FRAMES_PER_SECOND.: Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Rational# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..frames_per_secondrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#frames_per_second., |
| 868 | MULTI_VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MULTI_VIEW.: TextVectorrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TextVector# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..multi_view_namesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#multi_view_names., |
| 869 | WORLD_TO_CAMERArust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_CAMERA.: Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Matrix4x4# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera., |
| 870 | WORLD_TO_NDCrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_NDC.: Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Matrix4x4# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device., |
| 871 | DEEP_IMAGE_STATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_IMAGE_STATE.: Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Rational# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..deep_image_staterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#deep_image_state., |
| 872 | ORIGINAL_DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ORIGINAL_DATA_WINDOW.: IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..original_data_windowrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#original_data_window., |
| 873 | CHROMATICITIESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHROMATICITIES.: Chromaticitiesrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Chromaticities# = &self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..chromaticitiesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#chromaticities., |
| 874 | PREVIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PREVIEW.: Previewrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Preview# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..previewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#preview., |
| 875 | VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/VIEW.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..view_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#view_name., |
| 876 | NEARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/NEAR.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane., |
| 877 | FARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FAR.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane., |
| 878 | FOV_Xrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_X.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view., |
| 879 | FOV_Yrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_Y.: F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view., |
| 880 | SOFTWARErust-analyzer cargo exr 1.74.0 meta/header/standard_names/SOFTWARE.: Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text# = &self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..software_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#software_name. |
| 881 | ); |
| 882 | |
| 883 | let other = self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other..iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]iter().() |
| 884 | .chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(self.shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes..otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other..iterrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]iter().()) |
| 885 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(name, val)| (name.as_slicerust-analyzer cargo exr 1.74.0 meta/attribute/impl#[Text]as_slice().(), val.clonerust-analyzer cargo exr 1.74.0 meta/attribute/impl#[AttributeValue][Clone]clone().())); // TODO no clone |
| 886 | |
| 887 | req_core_attrs |
| 888 | .chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(opt_core_attrs) |
| 889 | .chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(opt_attr) |
| 890 | .chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(other) |
| 891 | } |
| 892 | |
| 893 | /// Read the value without validating. |
| 894 | pub fn readrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]read().(read: &mut PeekReadrust-analyzer cargo exr 1.74.0 io/PeekRead#<impl Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#>, requirements: &Requirementsrust-analyzer cargo exr 1.74.0 meta/Requirements#, pedantic: bool) -> Resultrust-analyzer cargo exr 1.74.0 error/Result#<Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]> { |
| 895 | let max_string_len = if requirements.has_long_namesrust-analyzer cargo exr 1.74.0 meta/Requirements#has_long_names. { 256 } else { 32 }; // TODO DRY this information |
| 896 | |
| 897 | // these required attributes will be filled when encountered while parsing |
| 898 | let mut tiles = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 899 | let mut block_type = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 900 | let mut version = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 901 | let mut chunk_count = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 902 | let mut max_samples_per_pixel = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 903 | let mut channels = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 904 | let mut compression = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 905 | let mut data_window = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 906 | let mut display_window = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 907 | let mut line_order = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 908 | let mut dwa_compression_level = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 909 | |
| 910 | let mut layer_attributes = LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#::defaultrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default]default().(); |
| 911 | let mut image_attributes = ImageAttributesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#::newrust-analyzer cargo exr 1.74.0 meta/header/impl#[ImageAttributes]new().(IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#::zerorust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]zero().()); |
| 912 | |
| 913 | // read each attribute in this header |
| 914 | while !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().sequence_endrust-analyzer cargo exr 1.74.0 meta/sequence_end/::has_comerust-analyzer cargo exr 1.74.0 meta/sequence_end/has_come().(read)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 915 | let (attribute_name, value) = attributerust-analyzer cargo exr 1.74.0 meta/attribute/::readrust-analyzer cargo exr 1.74.0 meta/attribute/read().(read, max_string_len)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 916 | |
| 917 | // if the attribute value itself is ok, record it |
| 918 | match value { |
| 919 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) => { |
| 920 | use craterust-analyzer cargo exr 1.74.0 crate/::metarust-analyzer cargo exr 1.74.0 meta/::headerrust-analyzer cargo exr 1.74.0 meta/header/::standard_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ as namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/; |
| 921 | use craterust-analyzer cargo exr 1.74.0 crate/::metarust-analyzer cargo exr 1.74.0 meta/::attributerust-analyzer cargo exr 1.74.0 meta/attribute/::AttributeValuerust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#::*; |
| 922 | |
| 923 | // if the attribute is a required attribute, set the corresponding variable directly. |
| 924 | // otherwise, add the attribute to the vector of custom attributes |
| 925 | |
| 926 | // the following attributes will only be set if the type matches the commonly used type for that attribute |
| 927 | match (attribute_name.as_slicerust-analyzer cargo exr 1.74.0 meta/attribute/impl#[Text]as_slice().(), value) { |
| 928 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::BLOCK_TYPErust-analyzer cargo exr 1.74.0 meta/header/standard_names/BLOCK_TYPE., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => block_type = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(attributerust-analyzer cargo exr 1.74.0 meta/attribute/::BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::parserust-analyzer cargo exr 1.74.0 meta/attribute/impl#[BlockType]parse().(value)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().), |
| 929 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::TILESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/TILES., TileDescriptionrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TileDescription#(value)) => tiles = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 930 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::CHANNELSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHANNELS., ChannelListrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#ChannelList#(value)) => channels = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 931 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::COMPRESSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMPRESSION., Compressionrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Compression#(value)) => compression = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 932 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DATA_WINDOW., IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds#(value)) => data_window = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 933 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::DISPLAY_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DISPLAY_WINDOW., IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds#(value)) => display_window = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 934 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::LINE_ORDERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LINE_ORDER., LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#LineOrder#(value)) => line_order = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 935 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::DEEP_DATA_VERSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_DATA_VERSION., I32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#I32#(value)) => version = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 936 | |
| 937 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::MAX_SAMPLESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MAX_SAMPLES., I32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#I32#(value)) => max_samples_per_pixel = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#( |
| 938 | i32_to_usizerust-analyzer cargo exr 1.74.0 error/i32_to_usize().(value, "max sample count")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 939 | ), |
| 940 | |
| 941 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::CHUNKSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHUNKS., I32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#I32#(value)) => chunk_count = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#( |
| 942 | i32_to_usizerust-analyzer cargo exr 1.74.0 error/i32_to_usize().(value, "chunk count")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 943 | ), |
| 944 | |
| 945 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::NAMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/NAME., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 946 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WINDOW_CENTERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_CENTER., FloatVec2rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#FloatVec2#(value)) => layer_attributes.screen_window_centerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_center. = value, |
| 947 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WINDOW_WIDTHrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_WIDTH., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width. = value, |
| 948 | |
| 949 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WHITE_LUMINANCErust-analyzer cargo exr 1.74.0 meta/header/standard_names/WHITE_LUMINANCE., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.white_luminancerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#white_luminance. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 950 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ADOPTED_NEUTRALrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ADOPTED_NEUTRAL., FloatVec2rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#FloatVec2#(value)) => layer_attributes.adopted_neutralrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#adopted_neutral. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 951 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::RENDERING_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/RENDERING_TRANSFORM., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.rendering_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#rendering_transform_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 952 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::LOOK_MOD_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LOOK_MOD_TRANSFORM., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.look_modification_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#look_modification_transform_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 953 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::X_DENSITYrust-analyzer cargo exr 1.74.0 meta/header/standard_names/X_DENSITY., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.horizontal_densityrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_density. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 954 | |
| 955 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::OWNERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/OWNER., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.ownerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#owner. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 956 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::COMMENTSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMMENTS., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.commentsrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#comments. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 957 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::CAPTURE_DATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/CAPTURE_DATE., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.capture_daterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#capture_date. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 958 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::UTC_OFFSETrust-analyzer cargo exr 1.74.0 meta/header/standard_names/UTC_OFFSET., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.utc_offsetrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#utc_offset. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 959 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::LONGITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LONGITUDE., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.longituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#longitude. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 960 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::LATITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LATITUDE., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.latituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#latitude. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 961 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ALTITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/ALTITUDE., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.altituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#altitude. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 962 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::FOCUSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOCUS., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.focusrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#focus. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 963 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::EXPOSURE_TIMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/EXPOSURE_TIME., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.exposurerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#exposure. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 964 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::APERTURErust-analyzer cargo exr 1.74.0 meta/header/standard_names/APERTURE., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.aperturerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#aperture. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 965 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ISO_SPEEDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ISO_SPEED., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.iso_speedrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#iso_speed. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 966 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ENVIRONMENT_MAPrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ENVIRONMENT_MAP., EnvironmentMaprust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#EnvironmentMap#(value)) => layer_attributes.environment_maprust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#environment_map. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 967 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::KEY_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/KEY_CODE., KeyCoderust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#KeyCode#(value)) => layer_attributes.film_key_coderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#film_key_code. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 968 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WRAP_MODESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WRAP_MODES., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.wrap_mode_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#wrap_mode_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 969 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::FRAMES_PER_SECONDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FRAMES_PER_SECOND., Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Rational#(value)) => layer_attributes.frames_per_secondrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#frames_per_second. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 970 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::MULTI_VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MULTI_VIEW., TextVectorrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TextVector#(value)) => layer_attributes.multi_view_namesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#multi_view_names. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 971 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WORLD_TO_CAMERArust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_CAMERA., Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Matrix4x4#(value)) => layer_attributes.world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 972 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::WORLD_TO_NDCrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_NDC., Matrix4x4rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Matrix4x4#(value)) => layer_attributes.world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 973 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::DEEP_IMAGE_STATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_IMAGE_STATE., Rationalrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Rational#(value)) => layer_attributes.deep_image_staterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#deep_image_state. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 974 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::ORIGINAL_DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ORIGINAL_DATA_WINDOW., IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#IntegerBounds#(value)) => layer_attributes.original_data_windowrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#original_data_window. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 975 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::DWA_COMPRESSION_LEVELrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DWA_COMPRESSION_LEVEL., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => dwa_compression_level = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 976 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::PREVIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PREVIEW., Previewrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Preview#(value)) => layer_attributes.previewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#preview. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 977 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/VIEW., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.view_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#view_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 978 | |
| 979 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::NEARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/NEAR., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 980 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::FARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FAR., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 981 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::FOV_Xrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_X., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 982 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::FOV_Yrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_Y., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => layer_attributes.vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 983 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::SOFTWARErust-analyzer cargo exr 1.74.0 meta/header/standard_names/SOFTWARE., Textrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Text#(value)) => layer_attributes.software_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#software_name. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 984 | |
| 985 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::PIXEL_ASPECTrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PIXEL_ASPECT., F32rust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#F32#(value)) => image_attributes.pixel_aspectrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#pixel_aspect. = value, |
| 986 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::TIME_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/TIME_CODE., TimeCoderust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TimeCode#(value)) => image_attributes.time_coderust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#time_code. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 987 | (namerust-analyzer cargo exr 1.74.0 meta/header/standard_names/::CHROMATICITIESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHROMATICITIES., Chromaticitiesrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Chromaticities#(value)) => image_attributes.chromaticitiesrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#chromaticities. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value), |
| 988 | |
| 989 | // insert unknown attributes of these types into image attributes, |
| 990 | // as these must be the same for all headers |
| 991 | (_, value @ Chromaticitiesrust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#Chromaticities#(_)) | |
| 992 | (_, value @ TimeCoderust-analyzer cargo exr 1.74.0 meta/attribute/AttributeValue#TimeCode#(_)) => { |
| 993 | image_attributes.otherrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#other..insertrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]insert().(attribute_name, value); |
| 994 | }, |
| 995 | |
| 996 | // insert unknown attributes into layer attributes |
| 997 | (_, value) => { |
| 998 | layer_attributes.otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other..insertrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]insert().(attribute_name, value); |
| 999 | }, |
| 1000 | |
| 1001 | } |
| 1002 | }, |
| 1003 | |
| 1004 | // in case the attribute value itself is not ok, but the rest of the image is |
| 1005 | // only abort reading the image if desired |
| 1006 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(error) => { |
| 1007 | if pedantic { return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(error); } |
| 1008 | } |
| 1009 | } |
| 1010 | } |
| 1011 | |
| 1012 | // construct compression with parameters from properties |
| 1013 | let compression = match (dwa_compression_level, compression) { |
| 1014 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWAArust-analyzer cargo exr 1.74.0 compression/Compression#DWAA#(_))) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWAArust-analyzer cargo exr 1.74.0 compression/Compression#DWAA#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level))), |
| 1015 | (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWABrust-analyzer cargo exr 1.74.0 compression/Compression#DWAB#(_))) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Compressionrust-analyzer cargo exr 1.74.0 compression/Compression#::DWABrust-analyzer cargo exr 1.74.0 compression/Compression#DWAB#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(level))), |
| 1016 | (_, other) => other, |
| 1017 | // FIXME dwa compression level gets lost if any other compression is used later in the process |
| 1018 | }; |
| 1019 | |
| 1020 | let compression = compression.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("compression"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1021 | image_attributes.display_windowrust-analyzer cargo exr 1.74.0 meta/header/ImageAttributes#display_window. = display_window.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("display window"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1022 | |
| 1023 | let data_window = data_window.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("data window"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1024 | data_window.validaterust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]validate().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; // validate now to avoid errors when computing the chunk_count |
| 1025 | layer_attributes.layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position. = data_window.positionrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#position.; |
| 1026 | |
| 1027 | |
| 1028 | // validate now to avoid errors when computing the chunk_count |
| 1029 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(tiles) = tiles { tiles.validaterust-analyzer cargo exr 1.74.0 meta/attribute/impl#[TileDescription]validate().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; } |
| 1030 | let blocks = match block_type { |
| 1031 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# if requirements.is_single_layer_and_tiledrust-analyzer cargo exr 1.74.0 meta/Requirements#is_single_layer_and_tiled. => { |
| 1032 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("tiles"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 1033 | }, |
| 1034 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::Tilerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#Tile#) | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::DeepTilerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#DeepTile#) => { |
| 1035 | BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::Tilesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#Tiles#(tiles.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("tiles"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 1036 | }, |
| 1037 | |
| 1038 | _ => BlockDescriptionrust-analyzer cargo exr 1.74.0 meta/BlockDescription#::ScanLinesrust-analyzer cargo exr 1.74.0 meta/BlockDescription#ScanLines#, |
| 1039 | }; |
| 1040 | |
| 1041 | let computed_chunk_count = compute_chunk_countrust-analyzer cargo exr 1.74.0 meta/compute_chunk_count().(compression, data_window.sizerust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#size., blocks); |
| 1042 | if chunk_count.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() && pedantic && chunk_count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(computed_chunk_count) { |
| 1043 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo exr 1.74.0 error/Error#::invalidrust-analyzer cargo exr 1.74.0 error/impl#[Error]invalid().("chunk count not matching data size")); |
| 1044 | } |
| 1045 | |
| 1046 | let header = Headerrust-analyzer cargo exr 1.74.0 meta/header/Header# { |
| 1047 | compressionrust-analyzer cargo exr 1.74.0 meta/header/Header#compression., |
| 1048 | |
| 1049 | // always compute ourselves, because we cannot trust anyone out there 😱 |
| 1050 | chunk_countrust-analyzer cargo exr 1.74.0 meta/header/Header#chunk_count.: computed_chunk_count, |
| 1051 | |
| 1052 | layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.: data_window.sizerust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#size., |
| 1053 | |
| 1054 | shared_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#shared_attributes.: image_attributes, |
| 1055 | own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes.: layer_attributes, |
| 1056 | |
| 1057 | channelsrust-analyzer cargo exr 1.74.0 meta/header/Header#channels.: channels.ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(missing_attributerust-analyzer cargo exr 1.74.0 meta/missing_attribute().("channels"))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1058 | line_orderrust-analyzer cargo exr 1.74.0 meta/header/Header#line_order.: line_order.unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(LineOrderrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#::Unspecifiedrust-analyzer cargo exr 1.74.0 meta/attribute/LineOrder#Unspecified#), |
| 1059 | |
| 1060 | blocksrust-analyzer cargo exr 1.74.0 meta/header/Header#blocks., |
| 1061 | max_samples_per_pixelrust-analyzer cargo exr 1.74.0 meta/header/Header#max_samples_per_pixel., |
| 1062 | deep_data_versionrust-analyzer cargo exr 1.74.0 meta/header/Header#deep_data_version.: version, |
| 1063 | deeprust-analyzer cargo exr 1.74.0 meta/header/Header#deep.: block_type rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::DeepScanLinerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#DeepScanLine#) || block_type rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(BlockTyperust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#::DeepTilerust-analyzer cargo exr 1.74.0 meta/attribute/BlockType#DeepTile#), |
| 1064 | }; |
| 1065 | |
| 1066 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(header) |
| 1067 | } |
| 1068 | |
| 1069 | /// Without validation, write this instance to the byte stream. |
| 1070 | pub fn writerust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]write().(&self, write: &mut impl Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#) -> UnitResultrust-analyzer cargo exr 1.74.0 error/UnitResult# { |
| 1071 | for (name, value) in self.all_named_attributesrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]all_named_attributes().() { |
| 1072 | attributerust-analyzer cargo exr 1.74.0 meta/attribute/::writerust-analyzer cargo exr 1.74.0 meta/attribute/write().(name, &value, write)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1073 | } |
| 1074 | |
| 1075 | sequence_endrust-analyzer cargo exr 1.74.0 meta/sequence_end/::writerust-analyzer cargo exr 1.74.0 meta/sequence_end/write().(write)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1076 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1077 | } |
| 1078 | |
| 1079 | /// The rectangle describing the bounding box of this layer |
| 1080 | /// within the infinite global 2D space of the file. |
| 1081 | pub fn data_windowrust-analyzer cargo exr 1.74.0 meta/header/impl#[Header]data_window().(&self) -> IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds# { |
| 1082 | IntegerBoundsrust-analyzer cargo exr 1.74.0 meta/attribute/IntegerBounds#::newrust-analyzer cargo exr 1.74.0 meta/attribute/impl#[IntegerBounds]new().(self.own_attributesrust-analyzer cargo exr 1.74.0 meta/header/Header#own_attributes..layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position., self.layer_sizerust-analyzer cargo exr 1.74.0 meta/header/Header#layer_size.) |
| 1083 | } |
| 1084 | } |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | /// Collection of required attribute names. |
| 1089 | pub mod standard_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ { |
| 1090 | macro_rules! define_required_attribute_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/define_required_attribute_names! { |
| 1091 | ( $($name: ident : $value: expr),* ) => { |
| 1092 | |
| 1093 | /// A list containing all reserved names. |
| 1094 | pub const ALL: &'static [&'static [u8]] = &[ |
| 1095 | $( $value ),* |
| 1096 | ]; |
| 1097 | |
| 1098 | $( |
| 1099 | /// The byte-string name of this required attribute as it appears in an exr file. |
| 1100 | pub const $name: &'static [u8] = $value; |
| 1101 | )* |
| 1102 | }; |
| 1103 | } |
| 1104 | |
| 1105 | define_required_attribute_namesrust-analyzer cargo exr 1.74.0 meta/header/standard_names/define_required_attribute_names!! { |
| 1106 | TILESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/TILES.: b"tiles", |
| 1107 | NAMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/NAME.: b"name", |
| 1108 | BLOCK_TYPErust-analyzer cargo exr 1.74.0 meta/header/standard_names/BLOCK_TYPE.: b"type", |
| 1109 | DEEP_DATA_VERSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_DATA_VERSION.: b"version", |
| 1110 | CHUNKSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHUNKS.: b"chunkCount", |
| 1111 | MAX_SAMPLESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MAX_SAMPLES.: b"maxSamplesPerPixel", |
| 1112 | CHANNELSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHANNELS.: b"channels", |
| 1113 | COMPRESSIONrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMPRESSION.: b"compression", |
| 1114 | DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DATA_WINDOW.: b"dataWindow", |
| 1115 | DISPLAY_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DISPLAY_WINDOW.: b"displayWindow", |
| 1116 | LINE_ORDERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LINE_ORDER.: b"lineOrder", |
| 1117 | PIXEL_ASPECTrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PIXEL_ASPECT.: b"pixelAspectRatio", |
| 1118 | WINDOW_CENTERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_CENTER.: b"screenWindowCenter", |
| 1119 | WINDOW_WIDTHrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WINDOW_WIDTH.: b"screenWindowWidth", |
| 1120 | WHITE_LUMINANCErust-analyzer cargo exr 1.74.0 meta/header/standard_names/WHITE_LUMINANCE.: b"whiteLuminance", |
| 1121 | ADOPTED_NEUTRALrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ADOPTED_NEUTRAL.: b"adoptedNeutral", |
| 1122 | RENDERING_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/RENDERING_TRANSFORM.: b"renderingTransform", |
| 1123 | LOOK_MOD_TRANSFORMrust-analyzer cargo exr 1.74.0 meta/header/standard_names/LOOK_MOD_TRANSFORM.: b"lookModTransform", |
| 1124 | X_DENSITYrust-analyzer cargo exr 1.74.0 meta/header/standard_names/X_DENSITY.: b"xDensity", |
| 1125 | OWNERrust-analyzer cargo exr 1.74.0 meta/header/standard_names/OWNER.: b"owner", |
| 1126 | COMMENTSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/COMMENTS.: b"comments", |
| 1127 | CAPTURE_DATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/CAPTURE_DATE.: b"capDate", |
| 1128 | UTC_OFFSETrust-analyzer cargo exr 1.74.0 meta/header/standard_names/UTC_OFFSET.: b"utcOffset", |
| 1129 | LONGITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LONGITUDE.: b"longitude", |
| 1130 | LATITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/LATITUDE.: b"latitude", |
| 1131 | ALTITUDErust-analyzer cargo exr 1.74.0 meta/header/standard_names/ALTITUDE.: b"altitude", |
| 1132 | FOCUSrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOCUS.: b"focus", |
| 1133 | EXPOSURE_TIMErust-analyzer cargo exr 1.74.0 meta/header/standard_names/EXPOSURE_TIME.: b"expTime", |
| 1134 | APERTURErust-analyzer cargo exr 1.74.0 meta/header/standard_names/APERTURE.: b"aperture", |
| 1135 | ISO_SPEEDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ISO_SPEED.: b"isoSpeed", |
| 1136 | ENVIRONMENT_MAPrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ENVIRONMENT_MAP.: b"envmap", |
| 1137 | KEY_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/KEY_CODE.: b"keyCode", |
| 1138 | TIME_CODErust-analyzer cargo exr 1.74.0 meta/header/standard_names/TIME_CODE.: b"timeCode", |
| 1139 | WRAP_MODESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WRAP_MODES.: b"wrapmodes", |
| 1140 | FRAMES_PER_SECONDrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FRAMES_PER_SECOND.: b"framesPerSecond", |
| 1141 | MULTI_VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/MULTI_VIEW.: b"multiView", |
| 1142 | WORLD_TO_CAMERArust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_CAMERA.: b"worldToCamera", |
| 1143 | WORLD_TO_NDCrust-analyzer cargo exr 1.74.0 meta/header/standard_names/WORLD_TO_NDC.: b"worldToNDC", |
| 1144 | DEEP_IMAGE_STATErust-analyzer cargo exr 1.74.0 meta/header/standard_names/DEEP_IMAGE_STATE.: b"deepImageState", |
| 1145 | ORIGINAL_DATA_WINDOWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/ORIGINAL_DATA_WINDOW.: b"originalDataWindow", |
| 1146 | DWA_COMPRESSION_LEVELrust-analyzer cargo exr 1.74.0 meta/header/standard_names/DWA_COMPRESSION_LEVEL.: b"dwaCompressionLevel", |
| 1147 | PREVIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/PREVIEW.: b"preview", |
| 1148 | VIEWrust-analyzer cargo exr 1.74.0 meta/header/standard_names/VIEW.: b"view", |
| 1149 | CHROMATICITIESrust-analyzer cargo exr 1.74.0 meta/header/standard_names/CHROMATICITIES.: b"chromaticities", |
| 1150 | NEARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/NEAR.: b"near", |
| 1151 | FARrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FAR.: b"far", |
| 1152 | FOV_Xrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_X.: b"fieldOfViewHorizontal", |
| 1153 | FOV_Yrust-analyzer cargo exr 1.74.0 meta/header/standard_names/FOV_Y.: b"fieldOfViewVertical", |
| 1154 | SOFTWARErust-analyzer cargo exr 1.74.0 meta/header/standard_names/SOFTWARE.: b"software" |
| 1155 | } |
| 1156 | } |
| 1157 | |
| 1158 | |
| 1159 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes# { |
| 1160 | fn defaultrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default]default().() -> Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default] { |
| 1161 | Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default] { |
| 1162 | layer_positionrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_position.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0, 0), |
| 1163 | screen_window_centerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_center.: Vec2rust-analyzer cargo exr 1.74.0 math/Vec2#(0.0, 0.0), |
| 1164 | screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width.: 1.0, |
| 1165 | layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1166 | white_luminancerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#white_luminance.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1167 | adopted_neutralrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#adopted_neutral.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1168 | rendering_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#rendering_transform_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1169 | look_modification_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#look_modification_transform_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1170 | horizontal_densityrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_density.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1171 | ownerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#owner.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1172 | commentsrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#comments.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1173 | capture_daterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#capture_date.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1174 | utc_offsetrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#utc_offset.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1175 | longituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#longitude.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1176 | latituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#latitude.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1177 | altituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#altitude.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1178 | focusrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#focus.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1179 | exposurerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#exposure.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1180 | aperturerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#aperture.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1181 | iso_speedrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#iso_speed.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1182 | environment_maprust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#environment_map.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1183 | film_key_coderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#film_key_code.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1184 | wrap_mode_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#wrap_mode_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1185 | frames_per_secondrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#frames_per_second.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1186 | multi_view_namesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#multi_view_names.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1187 | world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1188 | world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1189 | deep_image_staterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#deep_image_state.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1190 | original_data_windowrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#original_data_window.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1191 | previewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#preview.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1192 | view_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#view_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1193 | software_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#software_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1194 | near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1195 | far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1196 | horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1197 | vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1198 | otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other.: Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default#::defaultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`][Default]default().() |
| 1199 | } |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | impl stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for LayerAttributesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes# { |
| 1204 | fn fmtrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Debug]fmt().(&self, formatter: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 1205 | let default_self = Selfrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Debug]::defaultrust-analyzer cargo exr 1.74.0 meta/header/impl#[LayerAttributes][Default]default().(); |
| 1206 | |
| 1207 | let mut debug = formatter.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("LayerAttributes (default values omitted)"); |
| 1208 | |
| 1209 | // always debug the following field |
| 1210 | debug.fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("name", &self.layer_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#layer_name.); |
| 1211 | |
| 1212 | macro_rules! debug_non_default_fieldsrust-analyzer cargo exr 1.74.0 meta/header/debug_non_default_fields! { |
| 1213 | ( $( $name: ident ),* ) => { $( |
| 1214 | |
| 1215 | if self.$name != default_self.$name { |
| 1216 | debug.field(stringify!($name), &self.$name); |
| 1217 | } |
| 1218 | |
| 1219 | )* }; |
| 1220 | } |
| 1221 | |
| 1222 | // only debug these fields if they are not the default value |
| 1223 | debug_non_default_fieldsrust-analyzer cargo exr 1.74.0 meta/header/debug_non_default_fields!! { |
| 1224 | screen_window_centerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_center., screen_window_widthrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#screen_window_width., |
| 1225 | white_luminancerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#white_luminance., adopted_neutralrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#adopted_neutral., horizontal_densityrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_density., |
| 1226 | rendering_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#rendering_transform_name., look_modification_transform_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#look_modification_transform_name., |
| 1227 | ownerrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#owner., commentsrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#comments., |
| 1228 | capture_daterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#capture_date., utc_offsetrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#utc_offset., |
| 1229 | longituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#longitude., latituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#latitude., altituderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#altitude., |
| 1230 | focusrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#focus., exposurerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#exposure., aperturerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#aperture., iso_speedrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#iso_speed., |
| 1231 | environment_maprust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#environment_map., film_key_coderust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#film_key_code., wrap_mode_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#wrap_mode_name., |
| 1232 | frames_per_secondrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#frames_per_second., multi_view_namesrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#multi_view_names., |
| 1233 | world_to_camerarust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_camera., world_to_normalized_devicerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#world_to_normalized_device., |
| 1234 | deep_image_staterust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#deep_image_state., original_data_windowrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#original_data_window., |
| 1235 | previewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#preview., view_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#view_name., |
| 1236 | vertical_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#vertical_field_of_view., horizontal_field_of_viewrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#horizontal_field_of_view., |
| 1237 | near_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#near_clip_plane., far_clip_planerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#far_clip_plane., software_namerust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#software_name. |
| 1238 | } |
| 1239 | |
| 1240 | for (name, value) in &self.otherrust-analyzer cargo exr 1.74.0 meta/header/LayerAttributes#other. { |
| 1241 | debug.fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().(&formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("\"{}\"", name), value); |
| 1242 | } |
| 1243 | |
| 1244 | // debug.finish_non_exhaustive() TODO |
| 1245 | debug.finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().() |
| 1246 | } |
| 1247 | } |