Skip to content

Opacity

Namespace Nfty.Core.Imaging in assembly Nfty.Core.

public static class Opacity

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>>)

public static bool HasPartialAlpha(IEnumerable<Image<Rgba32>> images);

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>)

public static bool HasPartialAlpha(Image<Rgba32> img);

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)

public static bool HasPartialAlpha(LoadedCookBook book);

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)

public static bool HasPartialAlpha(LoadedIngredient ing);

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)

public static bool HasPartialAlpha(LoadedRecipe recipe);

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)

public static bool IsPartial(Rgba32 p);

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)

public static bool IsSolid(Rgba32 p);

Whether a pixel is fully opaque.

Parameters

  • p (Rgba32) - The pixel to test.

Returns. true when the pixel's alpha is 255.