Advertisement
cloudmax

TE.js Texture Formats

Nov 16th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var textureFormats = {
  2.     i4: new TextureFormat({
  3.         id: 0x80,
  4.         name: "i4",
  5.         description: "4 bit per pixel. All channels share value.",
  6.         mask: {
  7.             r: 0xF,
  8.             g: 0xF,
  9.             b: 0xF,
  10.             a: 0xF
  11.         }
  12.     }),
  13.     i8: new TextureFormat({
  14.         id: 0x88,
  15.         name: "i8",
  16.         description: "8 bit per pixel. All channels share value.",
  17.         mask: {
  18.             r: 0xFF,
  19.             g: 0xFF,
  20.             b: 0xFF,
  21.             a: 0xFF
  22.         }
  23.     }),
  24.     ia4: new TextureFormat({
  25.         id: 0x60,
  26.         name: "ia4",
  27.         description: "4 bit per pixel. 3 bit for greyscale channel, 1 bit for alpha channel.",
  28.         mask: {
  29.             r: 0xE,
  30.             g: 0xE,
  31.             b: 0xE,
  32.             a: 0x1
  33.         }
  34.     }),
  35.     ia8: new TextureFormat({
  36.         id: 0x68,
  37.         name: "ia8",
  38.         description: "8 bit per pixel. 4 bit for greyscale channel, 4 bit for alpha channel.",
  39.         mask: {
  40.             r: 0xF0,
  41.             g: 0xF0,
  42.             b: 0xF0,
  43.             a: 0x0F
  44.         }
  45.     }),
  46.     ia16: new TextureFormat({
  47.         id: 0x70,
  48.         name: "ia16",
  49.         description: "16 bit per pixel. 8 bit for greyscale channel, 8 bit for alpha channel.",
  50.         mask: {
  51.             r: 0xFF00,
  52.             g: 0xFF00,
  53.             b: 0xFF00,
  54.             a: 0x00FF
  55.         }
  56.     }),
  57.     rgb5a1: new TextureFormat({
  58.         id: 0x10,
  59.         name: "rgb5a1",
  60.         description: "16 bit per pixel. 5 bit per color channel, 1 bit for alpha channel. Also known as rgba16.",
  61.         mask: {
  62.             r: 0xF800,
  63.             g: 0x07C0,
  64.             b: 0x003E,
  65.             a: 0x0001
  66.         }
  67.     }),
  68.     rgba32: new TextureFormat({
  69.         id: 0x18,
  70.         name: "rgba32",
  71.         description: "32 bit per pixel. 8 bit per color channel, 8 bit for alpha channel.",
  72.         mask: {
  73.             r: 0xFF000000,
  74.             g: 0x00FF0000,
  75.             b: 0x0000FF00,
  76.             a: 0x000000FF
  77.         }
  78.     }),
  79.     ci4: new TextureFormat({
  80.         id: 0x40,
  81.         name: "ci4",
  82.         description: "4 bit per pixel. Uses a rgb5a1 palette.",
  83.         bits: 4,
  84.         palette: true
  85.     }),
  86.     ci8: new TextureFormat({
  87.         id: 0x48,
  88.         name: "ci8",
  89.         description: "8 bit per pixel. Uses a rgb5a1 palette.",
  90.         bits: 8,
  91.         palette: true
  92.     }),
  93.     jpeg: new TextureFormat({
  94.         id: 0xFE,
  95.         name: "jpeg",
  96.         description: "Uses the JPEG File Interchange Format (JFIF) standard.",
  97.         bits: 8
  98.     }),
  99. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement