Skip to main content

Module material

Module material 

Source
Expand description

Image material layers (画像素材レイヤー, R10): CSP keeps the original image (Layer.ResizableOriginalMipmap) and its placement (Layer.ResizableImageInfo), and draws the transformed image when it opens the file; the render mipmap is often not stored.

ResizableImageInfo (big endian, 184 bytes in the corpus):

+0   u32 120, 16, 4, 0, 1, 3, 2, 2 (meaning unknown)
+32  u32 original width, height (pixels)
+40  f64 scale x, scale y
+56  f64 0 (rotation, unconfirmed)
+64  f64 centre x, y (layer pixels)
+80  f64 pivot x, y in the original (half its size)
+96  u32 3, 1, 0, 1, 0, 1 (meaning unknown)
+120 f64 × 8: where the original's corners go, (0, 0), (w, 0), (0, h),
     (w, h), in layer pixels (add `LayerOffsetX/Y` for the canvas)

The corners define the transform, so scaling, rotation, flips and free (perspective) transforms are all drawn the same way: each output pixel is mapped back into the original with the homography of the four corners and sampled bilinearly (the edge is hard: outside the image is transparent).

Structs§

Placement
The placement of an image material.