12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace bbiwarg.DataSource
- {
- class ColorImage
- {
- private int width, height;
- private byte[] data;
- public ColorImage(int width, int height, byte[] data)
- {
- this.width = width;
- this.height = height;
- this.data = data;
- }
- public int getWidth()
- {
- return width;
- }
- public int getHeight()
- {
- return height;
- }
- public Color4 getColor(int x, int y)
- {
- return new Color4(data[4 * (y * width + x) + 3], data[4 * (y * width + x) + 0],
- data[4 * (y * width + x) + 1], data[4 * (y * width + x) + 2]);
- }
- }
- }
|