public ImageSharpTexture(Image <Rgba32> image, bool mipmap = true) { if (mipmap) { Images = MipmapHelper.GenerateMipmaps(image); } else { Images = new Image <Rgba32>[] { image }; } }
public ImageSharpTexture(Image <Rgba32> image, bool mipmap, bool srgb) { Format = srgb ? PixelFormat.R8_G8_B8_A8_UNorm_SRgb : PixelFormat.R8_G8_B8_A8_UNorm; if (mipmap) { Images = MipmapHelper.GenerateMipmaps(image); } else { Images = new Image <Rgba32>[] { image }; } }
public ImageSharpCubemapTexture( Image <Rgba32> positiveX, Image <Rgba32> negativeX, Image <Rgba32> positiveY, Image <Rgba32> negativeY, Image <Rgba32> positiveZ, Image <Rgba32> negativeZ, bool mipmap = true) { CubemapTextures = new Image <Rgba32> [6][]; if (mipmap) { CubemapTextures[0] = MipmapHelper.GenerateMipmaps(positiveX); CubemapTextures[1] = MipmapHelper.GenerateMipmaps(negativeX); CubemapTextures[2] = MipmapHelper.GenerateMipmaps(positiveY); CubemapTextures[3] = MipmapHelper.GenerateMipmaps(negativeY); CubemapTextures[4] = MipmapHelper.GenerateMipmaps(positiveZ); CubemapTextures[5] = MipmapHelper.GenerateMipmaps(negativeZ); } else { CubemapTextures[0] = new Image <Rgba32>[1] { positiveX }; CubemapTextures[1] = new Image <Rgba32>[1] { negativeX }; CubemapTextures[2] = new Image <Rgba32>[1] { positiveY }; CubemapTextures[3] = new Image <Rgba32>[1] { negativeY }; CubemapTextures[4] = new Image <Rgba32>[1] { positiveZ }; CubemapTextures[5] = new Image <Rgba32>[1] { negativeZ }; } }