RGBImage               package:R.image               R Documentation

_T_h_e _R_G_B_I_m_a_g_e _c_l_a_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     Package:  R.image 
      *Class RGBImage*

     'Object'
      '~~|'
      '~~+--''BitmapImage'
      '~~~~~~~|'
      '~~~~~~~+--''RGBImage'

     *Directly known subclasses:*


     public static class *RGBImage*
      extends _BitmapImage_

     The RGBImage class provides methods to read, write and display
     images in the RGB file format.

_U_s_a_g_e:

     RGBImage(R=NULL, G=NULL, B=NULL, ndim=3)

_A_r_g_u_m_e_n_t_s:

   R,G,B: Three 'numeric' NxK 'matrix' for the red, the green, and the
          blue channel, respectively.

    ndim: The number of dimension of the image.

_F_i_e_l_d_s _a_n_d _M_e_t_h_o_d_s:

     *Fields*

       'R'      The red channel data.
       'G'      The green channel data.
       'B'      The blue channel data.
       'depth'  The depth in bitlayers.

     Note that 'R', 'G' and 'B' must have values in the range [0,255].
     They must be matrices of the same dimension with the number of
     rows equal to the height of the image, and the number of columns
     equal to the width of the image. The elements in the first row and
     the first column of the matrices represents the top left pixel.

     *Methods:*

         'as.GrayImage'        -
         'as.MonochromeImage'  Converts an RGB image to a gray scale image.
         'as'                  -
         'as.RGBImage'         -
         'crop'                Crops the image.
         'dim'                 -
         'equals'              Compares two RGBImage's.
         'getColors'           -
         'paste'               Pastes another RGBImage or image layers to this image.
         'readPPM'             -
         'readRGB'             -
         'writePBM'            -
         'writePGM'            -
         'writePPM'            Writes the image to a file in Portable PixMap (PPM) format.
         'writeRGB'            Writes the image to a file in RGB format.

     *Methods inherited from BitmapImage*:
      as.character, depth, dim, getColorMap, getColors, height, image,
     plot, points, read, readJPEG, readUsingExternal, width, write,
     writeBMP, writeEPS, writeJPG, writePBM, writePGM, writePNG,
     writePPM, writeRGB

     *Methods inherited from Object*:
      $, $<-, [[, [[<-, as.character, attach, attachLocally,
     clearCache, clone, detach, equals, extend, finalize, gc,
     getEnvironment, getFields, getInstanciationTime,
     getStaticInstance, hasField, hashCode, ll, load, objectSize,
     print, save

_A_u_t_h_o_r(_s):

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

_S_e_e _A_l_s_o:

     For converting images in of file formats see ImageMagick (<URL:
     http://www.imagemagick.org>), which is free and available for many
     differt platforms.

_E_x_a_m_p_l_e_s:

     rgb <- BitmapImage$read("logosm.ppm", path=system.file("images", package="R.image"))

     layout(matrix(1:4,ncol=2))
     image(rgb)
     for (ch in 1:3) {
       coefs <- c(0,0,0)
       coefs[ch] <- 1
       chimg <- as.RGBImage(rgb, coefs=coefs)
       image(chimg)
     }

