// File: tomfunkhouser[P]gaps/pkgs/RGBD/RGBDImage.cpp
// Function: gaps::RGBDImage::ColorChannels() const
R2Image RGBDImage::
ColorChannels(void) const
{
  // Initialize image
  R2Image image(NPixels(RN_X), NPixels(RN_Y), 3);

  // Fill image
  R2Grid *red_channel = Channel(RGBD_RED_CHANNEL);
  R2Grid *green_channel = Channel(RGBD_GREEN_CHANNEL);
  R2Grid *blue_channel = Channel(RGBD_BLUE_CHANNEL);
  for (int j = 0; j < image.Height(); j++) {
    for (int i = 0; i < image.Width(); i++) {
      RNScalar r = red_channel->GridValue(i, j);
      RNScalar g = green_channel->GridValue(i, j);
      RNScalar b = blue_channel->GridValue(i, j);
      image.SetPixelRGB(i, j, RNRgb(r, g, b));
    }
  }

  // Return image
  return image;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movb $0x0, 0xd7(%rsp)
xorl %esi, %esi
movl %esi, 0x64(%rsp)
callq 0x1af30
movq 0x58(%rsp), %rdi
movl %eax, 0x54(%rsp)
movl $0x1, %esi
callq 0x1af30
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %esi
movl %eax, %edx
movl $0x3, %ecx
callq 0xd1c40
movq 0x58(%rsp), %rdi
movl 0x64(%rsp), %esi
callq 0x30690
movq %rax, 0x68(%rsp)
jmp 0x2cd51
movq 0x58(%rsp), %rdi
movq 0x68(%rsp), %rax
movq %rax, 0xc8(%rsp)
movl $0x1, %esi
callq 0x30690
movq %rax, 0x38(%rsp)
jmp 0x2cd74
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0xb0(%rsp)
movl $0x2, %esi
callq 0x30690
movq %rax, 0x30(%rsp)
jmp 0x2cd97
movq 0x30(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
movq 0x48(%rsp), %rdi
movl 0xa4(%rsp), %eax
movl %eax, 0x28(%rsp)
callq 0x22950
movl %eax, 0x2c(%rsp)
jmp 0x2cdca
movl 0x28(%rsp), %eax
movl 0x2c(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2cf4a
movl $0x0, 0xa0(%rsp)
movq 0x48(%rsp), %rdi
movl 0xa0(%rsp), %eax
movl %eax, 0x20(%rsp)
callq 0x22940
movl %eax, 0x24(%rsp)
jmp 0x2ce00
movl 0x20(%rsp), %eax
movl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2cf32
movq 0xc8(%rsp), %rdi
movl 0xa0(%rsp), %esi
movl 0xa4(%rsp), %edx
callq 0x1a060
movsd %xmm0, 0x18(%rsp)
jmp 0x2ce33
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0xb0(%rsp), %rdi
movl 0xa0(%rsp), %esi
movl 0xa4(%rsp), %edx
callq 0x1a060
movsd %xmm0, 0x10(%rsp)
jmp 0x2ce65
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0xa8(%rsp), %rdi
movl 0xa0(%rsp), %esi
movl 0xa4(%rsp), %edx
callq 0x1a060
movsd %xmm0, 0x8(%rsp)
jmp 0x2ce97
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0xa0(%rsp), %eax
movl %eax, (%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x4(%rsp)
movsd 0x98(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x88(%rsp), %xmm2
leaq 0x70(%rsp), %rdi
callq 0xdb1d0
jmp 0x2cee2
movl 0x4(%rsp), %edx
movl (%rsp), %esi
movq 0x48(%rsp), %rdi
leaq 0x70(%rsp), %rcx
callq 0xd2490
jmp 0x2cefa
jmp 0x2cefc
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x2cde5
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
callq 0xd2160
jmp 0x2cf73
jmp 0x2cf34
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x2cdaf
movb $0x1, 0xd7(%rsp)
testb $0x1, 0xd7(%rsp)
jne 0x2cf66
movq 0x48(%rsp), %rdi
callq 0xd2160
movq 0x40(%rsp), %rax
addq $0xe8, %rsp
retq
movq 0xc0(%rsp), %rdi
callq 0x12c20