LIBEUNOMIA
読み取り中…
検索中…
一致する文字列を見つけられません
picture.h
[詳解]
1/*
2 * Copyright 2001-2021 oZ/acy (名賀月晃嗣)
3 * Redistribution and use in source and binary forms,
4 * with or without modification,
5 * are permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
41#ifndef INCLUDE_GUARD_EUNOMIA_PICTURE_H
42#define INCLUDE_GUARD_EUNOMIA_PICTURE_H
43
44#include <memory>
45#include "imagebuffer.h"
46#include "colour.h"
47
48
49namespace eunomia
50{
51 class PictureRgba;
52 class PictureIndexed;
53
54
58class Picture : public ImageBuffer<RgbColour>
59{
60private:
62 std::unique_ptr<RgbColour[]> upbuf_;
63
64protected:
68 Picture(unsigned w, unsigned h);
69
70public:
76 static std::unique_ptr<Picture> create(unsigned w, unsigned h) noexcept;
77
79 std::unique_ptr<Picture> clone() const noexcept;
80
84 //void grayscale() noexcept;
85
89 std::unique_ptr<PictureIndexed>
90 createGrayscaledPictureIndexed() const noexcept;
91
95 std::unique_ptr<PictureIndexed> duplicatePictureIndexed() const noexcept;
96
108 std::unique_ptr<Picture>
109 magnify(int w, int h, double a = -1.0) const noexcept;
110
114 std::unique_ptr<Picture> reduce(int w, int h) const noexcept;
115};
116
117
118}// end of namespace eunomia
119
120
121
122
123#endif // INCLUDE_GUARD_EUNOMIA_PICTURE_H
畫像バッファ基底クラステンプレート
Definition imagebuffer.h:84
RGB24bitの畫像バッファ
Definition picture.h:59
std::unique_ptr< Picture > magnify(int w, int h, double a=-1.0) const noexcept
擴大
Definition pict_magnify.cpp:47
Picture(unsigned w, unsigned h)
構築子
Definition picture.cpp:44
std::unique_ptr< PictureIndexed > createGrayscaledPictureIndexed() const noexcept
グレイスケール化複製
Definition pict_grayscaled.cpp:43
static std::unique_ptr< Picture > create(unsigned w, unsigned h) noexcept
畫像バッファ生成
Definition picture.cpp:54
std::unique_ptr< PictureIndexed > duplicatePictureIndexed() const noexcept
減色(インデックスカラー化)
Definition pict_dupl_pictidx.cpp:43
std::unique_ptr< Picture > clone() const noexcept
複製
Definition picture.cpp:66
std::unique_ptr< Picture > reduce(int w, int h) const noexcept
縮小
Definition pict_reduce.cpp:114
RGB24bit色及びRGBA32bit色
畫像バッファクラステンプレート
Definition colour.h:49