OFbkImage.cc

Go to the documentation of this file.
00001 /*
00002  * This file is part of openSDK.
00003  *
00004  * Copyright (C) 2006-2007 openSDK team
00005  *
00006  * openSDK is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; version 2.
00009  *
00010  * openSDK is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with openSDK; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  *
00019  *     $Id: OFbkImage.cc,v 1.4 2007/04/02 17:45:57 nuno-lopes Exp $
00020  */
00021 
00022 #include <OPENR/OFbkImage.h>
00023 #include <OPENR/OSyslog.h>
00024 
00025 OFbkImage::OFbkImage(OFbkImageInfo *info, byte *data, OFbkImageBand band)
00026 {
00027         width_  = info->width;
00028         height_ = info->height;
00029         skip_   = 0;
00030 
00031         switch (band) {
00032                 case ofbkimageBAND_Y:
00033                         image_  = data;
00034                         break;
00035                 case ofbkimageBAND_Cr:
00036                         image_  = data + width_ * height_;
00037                         break;
00038                 case ofbkimageBAND_Cb:
00039                         image_  = data + width_ * height_ * 2;
00040                         break;
00041 
00042 
00043                 // TODO: implement these
00044                 case ofbkimageBAND_CDT:
00045                 case ofbkimageBAND_Y_LH:
00046                 case ofbkimageBAND_Y_HL:
00047                 case ofbkimageBAND_Y_HH:
00048                         image_ = data;
00049                         break;
00050 
00051                 default:
00052                         OSYSLOG1((osyslogERROR, "OFbkImage::OFbkImage: band not understood: %d", band));
00053         }
00054 }
00055 
00056 OFbkImage::~OFbkImage()
00057 {
00058         // nothing to do
00059 }
00060 
00061 OFbkImage& OFbkImage::operator=(const OFbkImage& fbk_image)
00062 {
00063         image_  = fbk_image.Pointer();
00064         width_  = fbk_image.Width();
00065         height_ = fbk_image.Height();
00066         skip_   = fbk_image.Skip();
00067         return *this;
00068 }

Generated on Sun Dec 2 23:04:30 2007 for openSDK by  doxygen 1.3.9.1