modular_aphelion/modules/bulge/code/print_derivation.dm 
| BULGE_OVER | One channel of a pixel under translucent white or black (OVER): round(base + (target - base) * alpha / 255). The exact value is a whole number of 255ths, which never sits on a half, so rounding cannot differ from the rule's. |
|---|---|
| /datum/bulge_print_template | A bulge shape template decoded for printing: which kind of pushed-out cloth sits at each pixel facing south, east and west (nothing prints facing north). Decoded once per template from a kind map in the template sheets by bulge_decode_template(), or past small_cap derived from the game's sprites (templates.dm), and kept in GLOB.bulge_print_templates. |
| /proc/bulge_print_patch | Returns the printed patch for a garment sprite under a bulge template: one registered icon whose state "" faces south, east and west (north stays empty), drawn over the garment where the bulge pushes it out. Derived the first time and cached; null when the sprite has no print to carry, or is not a 32x32 resource. |
| /proc/bulge_blank_tile | A transparent 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it. |
| /proc/bulge_derive_print_patch | Derives a printed patch (see bulge_print_patch()), uncached. |
| /proc/bulge_cut_cover_flap | Returns the cover garment with a flap cut away: its sprite with every pixel of the flap made transparent (the lifted part of a revealing skirt's hem), as one registered icon whose state "" faces all four ways; nothing is cut facing north. One flap serves every garment with that hem. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state. |
| /proc/bulge_cut_cover_patch | Returns a loincloth with its lifted flap cut away: its sprite kept only where the cut's keep mask (bulge_patch_keep()) is opaque, as one registered icon whose state "" faces all four ways. Only the mask's alpha is used, so the wearer's own garment pixels stay. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state. |
| /proc/bulge_four_way | A sprite's state as an icon with four directions, frame 1: a state with one direction is its south view every way, as getFlatIcon() treats one. Null when the state is missing or not 32x32. |
| /proc/bulge_derive_cut | Cuts a cover by a keep mask (see bulge_cut_cover_flap() and bulge_cut_cover_patch()), uncached: the sprite times the keep mask. |
| /proc/bulge_flap_keep | A flap's keep mask: opaque white over the whole 32x32 tile in all four directions except the flap's own pixels, which are transparent. Built once per flap (GLOB.bulge_flap_keeps), so a cut costs one multiply. |
| /proc/bulge_white_tile | A white 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it. |
| /proc/bulge_patch_keep | A loincloth cut's keep mask: opaque white over the whole 32x32 tile in all four directions, except the pixels the cut
takes away. Built once per cut (GLOB.bulge_patch_keeps) from erased, those pixels facing south, north, east and west
(lists of indices, row * 32 + column + 1 from the top left), which bulge_loincloth_cut() derives and passes before it
returns the cut; asked for again, without erased, it is the one built then. |
| /proc/bulge_template_masks | Derives the white masks an adaptive bulge of a template draws (see /datum/bulge_print_template/var/mask_cloth), once per template: one registered icon per kind it has pixels of, and one of all its kinds together. Their state "" faces all four ways; north stays empty. The palette is the client's tint on them, so a recolour derives nothing. |
| /proc/bulge_mask_tile | A mask placed on the 32x32 tile, in all four directions: transparent outside the mask. Built once per state
(GLOB.bulge_mask_tiles), kept on the server and never sent: drawn from pixels when given (a derived mask's pixels
as a template, as bulge_derive_large() derives them and bulge_exposed() passes them before it returns the mask), else
from the mask's sheet. |
| /proc/bulge_masked_icon | Returns anatomy restricted to a mask: an icon state's frames kept only where a white mask is opaque (the bare part of a penis past a family's small_cap, or what of it shows above a skirt), as one registered icon whose state "" faces all four ways. The image drawing it keeps the anatomy's own colour, so one masked copy serves every colouring. Cached by its inputs; null when the state is missing or not 32x32. |
| /proc/bulge_clipped_icon | Returns a sprite kept only inside a shape's pixels (what a cover draws over itself, kept to a look's cloth): the sprite's frames times the template's union mask (bulge_template_masks()), as one registered icon whose state "" faces all four ways. The image drawing it keeps the sprite's own colour. Cached on the template by sprite and state; null when the state is missing or not 32x32, or the template has no pixels. |
| /proc/bulge_register_icon | Registers an icon built at run time in the resource cache, as tg's derived icons are. The GetPixel() makes BYOND finish its deferred icon operations first, as GAGS does before it caches an icon. |
| /proc/bulge_print_colour | The colour of a patch pixel (rgb() text) from the garment pixel the rule chose (GetPixel() text): the pixel itself for cloth, or the pixel under the kind's translucent white or black. A partly transparent garment pixel gives its colour; patches are opaque. |
| /proc/bulge_two_prints | Whether two pixels (GetPixel() text) are different colours of a print (red and yellow, red and white) rather than one colour lighter or darker (black and its shine): one has chroma 30 or more and the other not, or both do and their hues are 25 degrees or more apart. Hues are compared as exact fractions, never as floating point; so a hue difference of exactly 25 degrees counts as two prints here, where the preview's colorsys floats may land a hair below 25 and call it one (no approved garment comes near a tie: the smallest margin in the corpus is 1.87 degrees). |
| /proc/bulge_hue_numerator | A colour's hue in sixths of a turn times its chroma, in [0, 6 * chroma): the hue as an exact fraction over chroma. |
| /proc/bulge_mirror | value folded into first..last as between two mirrors, the ends not repeated, so alternating stripes keep
alternating across the fold. |
| /proc/bulge_nearest_run | The index in runs (flat ascending (first, last) pairs) of the run nearest value; the first of equals. |
| /datum/bulge_print_reader | One direction of a worn sprite while a patch is derived, read a row at a time: rows the rule never visits are never read. Lives for one derivation. |
Define Details
BULGE_OVER 
One channel of a pixel under translucent white or black (OVER): round(base + (target - base) * alpha / 255). The exact value is a whole number of 255ths, which never sits on a half, so rounding cannot differ from the rule's.