|
rpm-build |
d2b433 |
/*
|
|
rpm-build |
d2b433 |
* libopenraw - rawdata.h
|
|
rpm-build |
d2b433 |
*
|
|
rpm-build |
d2b433 |
* Copyright (C) 2007-2008, 2012 Hubert Figuière
|
|
rpm-build |
d2b433 |
* Copyright (C) 2008 Novell, Inc.
|
|
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_RAWDATA_H_
|
|
rpm-build |
d2b433 |
#define LIBOPENRAWPP_RAWDATA_H_
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
#include <memory>
|
|
rpm-build |
d2b433 |
#include <vector>
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
#include <libopenraw/metadata.h>
|
|
rpm-build |
d2b433 |
#include "bitmapdata.hpp"
|
|
rpm-build |
d2b433 |
#include "cfapattern.hpp"
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
namespace OpenRaw {
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
class RawData
|
|
rpm-build |
d2b433 |
: public BitmapData
|
|
rpm-build |
d2b433 |
{
|
|
rpm-build |
d2b433 |
public:
|
|
rpm-build |
d2b433 |
static RawData * getAndExtractRawData(const char* filename,
|
|
rpm-build |
d2b433 |
uint32_t options,
|
|
rpm-build |
d2b433 |
or_error & err);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
RawData();
|
|
rpm-build |
d2b433 |
virtual ~RawData();
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
RawData(const RawData& f) = delete;
|
|
rpm-build |
d2b433 |
RawData & operator=(const RawData&) = delete;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** Get the rendered image
|
|
rpm-build |
d2b433 |
* @param bitmapdata the BitmapData to put the image into
|
|
rpm-build |
d2b433 |
* @param options the option bits. Pass 0 for now.
|
|
rpm-build |
d2b433 |
* @return the error code
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
// deprecate rename black level and white level resp.
|
|
rpm-build |
d2b433 |
uint16_t blackLevel() const;
|
|
rpm-build |
d2b433 |
uint16_t whiteLevel() const;
|
|
rpm-build |
d2b433 |
void setBlackLevel(uint16_t _m);
|
|
rpm-build |
d2b433 |
void setWhiteLevel(uint16_t _m);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/**
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
void setPhotometricInterpretation(ExifPhotometricInterpretation pi);
|
|
rpm-build |
d2b433 |
ExifPhotometricInterpretation getPhotometricInterpretation() const;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** Get colour matrix 1
|
|
rpm-build |
d2b433 |
* @param index The matrix index.
|
|
rpm-build |
d2b433 |
* @param size the size of the buffer.
|
|
rpm-build |
d2b433 |
* @return an array of %size double.
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
const double* getColourMatrix1(uint32_t & size) const;
|
|
rpm-build |
d2b433 |
void setColourMatrix1(const double* matrix, uint32_t size);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** Get colour matrix 2
|
|
rpm-build |
d2b433 |
* @param index The matrix index.
|
|
rpm-build |
d2b433 |
* @param size the size of the buffer.
|
|
rpm-build |
d2b433 |
* @return an array of %size double.
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
const double* getColourMatrix2(uint32_t & size) const;
|
|
rpm-build |
d2b433 |
void setColourMatrix2(const double* matrix, uint32_t size);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** swap the two objects data. */
|
|
rpm-build |
d2b433 |
void swap(RawData & with);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
virtual void *allocData(const size_t s) override;
|
|
rpm-build |
d2b433 |
virtual void setDimensions(uint32_t x, uint32_t y) override;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
void setCfaPatternType(::or_cfa_pattern t);
|
|
rpm-build |
d2b433 |
/**
|
|
rpm-build |
d2b433 |
* @return the const CfaPattern*.
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
const CfaPattern* cfaPattern() const;
|
|
rpm-build |
d2b433 |
void setCfaPattern(const CfaPattern* pattern);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
uint32_t compression() const;
|
|
rpm-build |
d2b433 |
void setCompression(uint32_t c);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
void setSlices(const std::vector<uint16_t> & slices);
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/** append a uint8_t at the current position */
|
|
rpm-build |
d2b433 |
// BitmapData &append(uint8_t c);
|
|
rpm-build |
d2b433 |
/** append a uint18_t at the current position */
|
|
rpm-build |
d2b433 |
RawData &append(uint16_t c);
|
|
rpm-build |
d2b433 |
/** Jump to next row. Take slicing into account. */
|
|
rpm-build |
d2b433 |
void nextRow();
|
|
rpm-build |
d2b433 |
private:
|
|
rpm-build |
d2b433 |
class Private;
|
|
rpm-build |
d2b433 |
RawData::Private *d;
|
|
rpm-build |
d2b433 |
};
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
typedef std::unique_ptr<RawData> RawDataPtr;
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
}
|
|
rpm-build |
d2b433 |
|
|
rpm-build |
d2b433 |
/*
|
|
rpm-build |
d2b433 |
Local Variables:
|
|
rpm-build |
d2b433 |
mode:c++
|
|
rpm-build |
d2b433 |
c-file-style:"stroustrup"
|
|
rpm-build |
d2b433 |
c-file-offsets:((innamespace . 0))
|
|
rpm-build |
d2b433 |
indent-tabs-mode:nil
|
|
rpm-build |
d2b433 |
fill-column:80
|
|
rpm-build |
d2b433 |
End:
|
|
rpm-build |
d2b433 |
*/
|
|
rpm-build |
d2b433 |
#endif
|