|
rpm-build |
d2b433 |
/*
|
|
rpm-build |
d2b433 |
* libopenraw - bitmapdata.h
|
|
rpm-build |
d2b433 |
*
|
|
rpm-build |
d2b433 |
* Copyright (C) 2007 Hubert Figuiere
|
|
rpm-build |
d2b433 |
*
|
|
rpm-build |
d2b433 |
* This library is free software: you can redistribute it and/or
|
|
rpm-build |
d2b433 |
* modify it under the terms of the GNU Lesser General Public License
|
|
rpm-build |
d2b433 |
* as published by the Free Software Foundation, either version 3 of
|
|
rpm-build |
d2b433 |
* the License, or (at your option) any later version.
|
|
rpm-build |
d2b433 |
*
|
|
rpm-build |
d2b433 |
* This library is distributed in the hope that it will be useful,
|
|
rpm-build |
d2b433 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
rpm-build |
d2b433 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
rpm-build |
d2b433 |
* Lesser General Public License for more details.
|
|
rpm-build |
d2b433 |
*
|
|
rpm-build |
d2b433 |
* You should have received a copy of the GNU Lesser General Public
|
|
rpm-build |
d2b433 |
* License along with this library. If not, see
|
|
rpm-build |
d2b433 |
* <http://www.gnu.org/licenses/>.
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
#ifndef LIBOPENRAWPP_BITMAPDATA_H_
|
|
rpm-build |
d2b433 |
#define LIBOPENRAWPP_BITMAPDATA_H_
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
#include <libopenraw/prefix.h>
|
|
rpm-build |
d2b433 |
#include <libopenraw/rawdata.h>
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
namespace OpenRaw {
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
class BitmapData
|
|
rpm-build |
d2b433 |
{
|
|
rpm-build |
d2b433 |
public:
|
|
rpm-build |
d2b433 |
typedef ::or_data_type DataType;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
BitmapData();
|
|
rpm-build |
d2b433 |
virtual ~BitmapData();
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** swap the two objects data. */
|
|
rpm-build |
d2b433 |
void swap(BitmapData & with);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** return the data type */
|
|
rpm-build |
d2b433 |
DataType dataType() const;
|
|
rpm-build |
d2b433 |
/** set the data type */
|
|
rpm-build |
d2b433 |
void setDataType(DataType _type);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
virtual void *allocData(const size_t s);
|
|
rpm-build |
d2b433 |
/** return the size of the data */
|
|
rpm-build |
d2b433 |
size_t size() const;
|
|
rpm-build |
d2b433 |
void *data() const;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** width of the image data */
|
|
rpm-build |
d2b433 |
OR_DEPRECATED uint32_t x() const;
|
|
rpm-build |
d2b433 |
uint32_t width() const;
|
|
rpm-build |
d2b433 |
/** height of the image data */
|
|
rpm-build |
d2b433 |
OR_DEPRECATED uint32_t y() const;
|
|
rpm-build |
d2b433 |
uint32_t height() const;
|
|
rpm-build |
d2b433 |
/** bit per channel */
|
|
rpm-build |
d2b433 |
uint32_t bpc() const;
|
|
rpm-build |
d2b433 |
/** set bit per channel */
|
|
rpm-build |
d2b433 |
void setBpc(uint32_t _bpc);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** set the pixel dimensions of the bitmap */
|
|
rpm-build |
d2b433 |
virtual void setDimensions(uint32_t x, uint32_t y);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** retrieve the region of interest within the data
|
|
rpm-build |
d2b433 |
* the only guarantee is that if the width or height is 0
|
|
rpm-build |
d2b433 |
* when setting the dimensions the first time
|
|
rpm-build |
d2b433 |
* they'll be set to width() and height()
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
uint32_t roi_x() const;
|
|
rpm-build |
d2b433 |
uint32_t roi_y() const;
|
|
rpm-build |
d2b433 |
uint32_t roi_width() const;
|
|
rpm-build |
d2b433 |
uint32_t roi_height() const;
|
|
rpm-build |
d2b433 |
void setRoi(uint32_t x, uint32_t y, uint32_t w, uint32_t h);
|
|
rpm-build |
d2b433 |
private:
|
|
rpm-build |
d2b433 |
class Private;
|
|
rpm-build |
d2b433 |
BitmapData::Private *d;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** private copy constructor to make sure it is not called */
|
|
rpm-build |
d2b433 |
BitmapData(const BitmapData& f);
|
|
rpm-build |
d2b433 |
/** private = operator to make sure it is never called */
|
|
rpm-build |
d2b433 |
BitmapData & operator=(const BitmapData&);
|
|
rpm-build |
d2b433 |
};
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
}
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
#endif
|