blockWidth property

int get blockWidth

The width, in texels, of a single block. Uncompressed formats return 1.

Implementation

int get blockWidth {
  switch (this) {
    case PixelFormat.astc8x8LDR:
    case PixelFormat.astc8x8LDRSRGB:
    case PixelFormat.astc8x8HDR:
      return 8;
    case PixelFormat.bc1RGBAUNormInt:
    case PixelFormat.bc1RGBAUNormIntSRGB:
    case PixelFormat.bc3RGBAUNormInt:
    case PixelFormat.bc3RGBAUNormIntSRGB:
    case PixelFormat.bc5RGUNormInt:
    case PixelFormat.bc7RGBAUNormInt:
    case PixelFormat.bc7RGBAUNormIntSRGB:
    case PixelFormat.etc2RGB8UNormInt:
    case PixelFormat.etc2RGB8UNormIntSRGB:
    case PixelFormat.etc2RGBA8UNormInt:
    case PixelFormat.etc2RGBA8UNormIntSRGB:
    case PixelFormat.astc4x4LDR:
    case PixelFormat.astc4x4LDRSRGB:
    case PixelFormat.astc4x4HDR:
      return 4;
    // ignore: no_default_cases
    default:
      return 1;
  }
}