Opacity¶
Namespace Nfty.Core.Imaging in assembly Nfty.Core.
Whether a pixel — or a whole image, layer or book — carries partial alpha: a level of transparency that is neither fully there nor fully absent. This is the single definition of "partial" the rest of the product reads, including VoxelReport's per-pixel count, and it is also what the derived "2D only" flag (Rise) is built from.
Methods¶
HasPartialAlpha(IEnumerable<Image<Rgba32>>)¶
Whether any image in a sequence contains a partially transparent pixel. Stops at the first one it finds.
Parameters
images(IEnumerable<Image<Rgba32>>) - The images to scan, in order.
Returns. true as soon as a partial pixel is found in any image.
HasPartialAlpha(Image<Rgba32>)¶
Whether an image contains any partially transparent pixel. Stops at the first one it finds.
Parameters
img(Image<Rgba32>) - The image to scan.
Returns. true as soon as a partial pixel is found.
HasPartialAlpha(LoadedCookBook)¶
Whether any variant image anywhere in a book carries partial alpha.
Parameters
book(LoadedCookBook) - The book to scan.
Returns. true as soon as a partial pixel is found anywhere in it.
HasPartialAlpha(LoadedIngredient)¶
Whether any variant image of a layer carries partial alpha.
Parameters
ing(LoadedIngredient) - The layer to scan.
Returns. true as soon as a partial pixel is found in any of its variants.
HasPartialAlpha(LoadedRecipe)¶
Whether any layer's variant image in a recipe carries partial alpha.
Parameters
recipe(LoadedRecipe) - The recipe to scan.
Returns. true as soon as a partial pixel is found in any of its layers.
IsPartial(Rgba32)¶
Whether a pixel is partly transparent — neither fully opaque nor fully erased.
Parameters
p(Rgba32) - The pixel to test.
Returns. true when the pixel's alpha is neither 0 nor 255.
IsSolid(Rgba32)¶
Whether a pixel is fully opaque.
Parameters
p(Rgba32) - The pixel to test.
Returns. true when the pixel's alpha is 255.