public void Copy(ByteImage a, float scale) { byte * pa = a.Data(0, 0); float *p = data; for (int i = 0; i < width * height; i++) { *p++ = *pa++ *scale; } }
public void Copy(ByteImage byteImage) { byte * p = byteImage.Data(0, 0); RGB24 *pOut = data; for (int i = 0; i < width * height; i++) { pOut->R = pOut->G = pOut++->B = *p++; } }
public void Decimate(ByteImage a, int factor) { byte *output = data; for (int y = 0; y < height; y++) { byte *pa = a.Data(0, y * factor); for (int x = 0; x < width; x++) { *output++ = *pa; pa += factor; } } }
public void CopyRectangle(ByteImage byteImage, int startX, int startY, int w, int h) { byte * pOrig = byteImage.Data(0, 0); ARGB32 *pOutOrig = data; byte * p; ARGB32 *pOut; for (int j = startY; j < h; j++) { for (int i = startX; i < w; i++) { p = pOrig + j * byteImage.Width + i; pOut = pOutOrig + j * width + i; pOut->A = 255; pOut->R = pOut->G = pOut->B = *p; } } }