You are here: Architecture and Design > Scenes

Scenes

As implied in the previous section, when a read() call is made to an image stage, the scene of interest must be specified. A scene, implemented by the LTIScene class, has three basic properties:

The position is expressed in pixel space, relative to the given magnification, with (0,0) and (w-1,h-1) being the upper-left and lower-right corners of the image, where w and h are the width and height of the image (in pixels).

The scene width and height are also expressed in terms of pixels, but at the magnification of the scene. That is, the width and height values represent the pixel dimensions of the scene as decoded to the output buffer.

The magnification value is a floating point value representing the resolution or scale at which the image is to be read. A magnification of 1.0 corresponds to the full resolution of the image (one to one); a value of 0.5 represents the image at a downsampled view of half the full width and height, and a value of 2.0 represents the image at an upsampled view of twice the full width and height. Note: Only powers of two are supported for most image types (although filters for arbitrary resampling are available).

As an example, consider an image that is 625x625 pixels, as shown in Figure 1.

Figure 1:   Input scene; (x,y)=(0,0) (w,h)=(625, 625) mag=1.0

The middle rectangle in red corresponds to a full-resolution scene that is 200x200 pixels taken from the upper-left corner of the image. This is shown in Figure 2.

Figure 2:   Red Input scene: (x,y)=(0, 0) (w,h)=(200,200) mag=1.0

The inner rectangle in blue corresponds to a scene at twice the resolution (mag=2) that is also 200x200 pixels and also taken from the upper-left corner of the image. This scene is shown in Figure 3. Note that the scene is extracted into a buffer sized for 200x200 pixels, but the corresponding “footprint” in full-resolution space is only 100x100.

Figure 3:  Blue Input scene: (x,y)=(0, 0) (w,h)=(200,200) mag=2.0

The outer rectangle in green corresponds to a scene at mag=0.5 that is again 200x200 pixels from the upper-left corner of the image; see Figure 4. Note that the scene is extracted into a buffer sized for 200x200 pixels, but the corresponding footprint in full-resolution space is 400x400.

Figure 4:  Green Input scene: (x,y)=(0, 0) (w,h)=(200,200) mag=0.5

At mag=2.0 the scene is effectively sampling from an image of size 1250x1250. Likewise at mag=0.5 the scene is sampling from an image of size 313x313.

NOTE:  Not all image formats natively support multiresolution decoding. MrSID and JPEG 2000, being wavelet-based systems, efficiently support decoding at powers-of-two scales. In order to achieve this effect with other formats a resampling filter must be applied.