8 #ifndef DXLE_INC_TEXTURE_TEXTURE2D_TEXTURE2D_HPP_ 9 #define DXLE_INC_TEXTURE_TEXTURE2D_TEXTURE2D_HPP_ 12 #if defined(__c2__) && __clang_major__ == 3 && __clang_minor__ == 8 20 #include "../texture2d.hpp" 33 template<
typename BuffT,
typename OutFunc>
35 inline void LoadDivGraph_impl(OutFunc&& out_func, BuffT* HandleBuf,
const TCHAR *FileName,
int AllNum,
const dxle::sizei& Num,
const dxle::sizei& Size,
bool NotUse3DFlag)
37 DxLib::LoadDivGraph(FileName, AllNum, Num.width, Num.height, Size.width, Size.height, HandleBuf, NotUse3DFlag);
39 std::for_each(HandleBuf, HandleBuf + AllNum, [&out_func, &NotUse3DFlag](
int& handle){
42 out_func(std::move(temp));
47 std::for_each(HandleBuf, HandleBuf + AllNum, [](
int handle){
48 ::DxLib::DeleteGraph(handle);
55 return texture.GetHandle();
71 if (this->GetGraphFilePath(&buf[0]) == -1) {
80 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_MONO, Cb, Cr);
84 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_GAUSS, PixelWidth, Param);
88 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_DOWN_SCALE, DivNum);
92 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_BRIGHT_CLIP, clipmode, clip_pram, fillcolor, fillalpha);
96 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_HSB, HueType, Hue, Saturation, Bright);
100 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_INVERT);
104 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_LEVEL, min, max, Gamma, Aftermin, Aftermax);
108 return DxLib::GraphFilter(GetHandle(), DX_GRAPH_FILTER_LEVEL, threshold, LowColor, LowAlpha, HighColor, HighAlpha);
114 template<
typename Func_T>
119 int old_is_setting_reset;
121 : old_draw_screen(DxLib::GetDrawScreen())
122 , old_is_setting_reset(DxLib::GetUseSetDrawScreenSettingReset())
126 DxLib::SetDrawScreen(old_draw_screen);
127 DxLib::SetUseSetDrawScreenSettingReset(old_is_setting_reset);
131 DxLib::SetUseSetDrawScreenSettingReset(FALSE);
132 this->SetDrawScreen();
139 auto graph_size = GetGraphSize();
141 screen new_screen =
screen::MakeScreen(graph_size, static_cast<gr_impl::screen_handle_manager&>(*handle_manager).UseAlphaChannel);
142 this->BltDrawValidGraph({ 0, 0 }, graph_size, { 0, 0 }, new_screen);
143 return std::make_unique<screen>(std::move(new_screen));
153 std::move(std::begin(other.textures), std::end(other.textures), std::begin(textures));
159 std::move(std::begin(other.textures), std::end(other.textures), std::begin(textures));
164 load(FileName, Num, Size, NotUse3DFlag);
169 load(FileName, Num, Size, NotUse3DFlag);
175 auto iter = textures.begin();
182 load(FileName.c_str(), Num, Size, NotUse3DFlag);
187 for (
auto& i : textures)
197 : textures(std::move(other.textures))
201 textures = std::move(other.textures);
206 load(FileName, AllNum, Num, Size, NotUse3DFlag);
210 load(FileName, AllNum, Num, Size, NotUse3DFlag);
212 inline void derivative_texture2d::load(
const TCHAR *FileName,
int AllNum,
const dxle::sizei& Num,
const dxle::sizei& Size,
bool NotUse3DFlag)
214 auto HandleBuf = std::make_unique<int[]>(AllNum);
220 load(FileName.c_str(), AllNum, Num, Size, NotUse3DFlag);
248 using namespace graph2d;
int filter_two_color(uint8_t threshold, unsigned int LowColor, uint8_t LowAlpha, unsigned int HighColor, uint8_t HighAlpha)
derivative_texture2d() DXLE_NOEXCEPT_OR_NOTHROW
static derivative_texture2d LoadDivGraph(const TCHAR *FileName, int AllNum, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag=false)
std::basic_string< TCHAR > tstring
size_c< std::size_t > size
int filter_level(uint8_t min, uint8_t max, int Gamma, uint8_t Aftermin, uint8_t Aftermax)
texture2d DerivationGraph(int SrcX, int SrcY, int Width, int Height, const texture2d &SrcGraphHandle) DXLE_NOEXCEPT_OR_NOTHROW
指定のグラフィックの指定部分だけを抜き出して新たなグラフィックを作成する
derivative_texture2d LoadDivGraph(const TCHAR *FileName, int AllNum, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag)
画像ファイルを分割してグラフィックハンドルを作成する
std::unique_ptr< screen > cloneSc() const
画像を複製する
derivative_texture2d(derivative_texture2d &&) DXLE_NOEXCEPT_IF((std derivative_texture2d & operator=(const derivative_texture2d &)=delete
size_t tstrlen(const char *s)
static_derivative_texture2d & operator=(const static_derivative_texture2d &)=delete
static screen MakeScreen(int SizeX, int SizeY, bool UseAlphaChannel=false) DXLE_NOEXCEPT_OR_NOTHROW
SetDrawScreen で描画対象にできるグラフィックを作成する
void LoadDivGraph_impl(OutFunc &&out_func, BuffT *HandleBuf, const TCHAR *FileName, int AllNum, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag)
画像ファイルを分割してグラフィックハンドルを作成する
void load(const TCHAR *FileName, int AllNum, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag=false)
int filter_mono(int16_t Cb, int16_t Cr)
int filter_HSB(bool HueType, int16_t Hue, int Saturation, int16_t Bright)
void load(const TCHAR *FileName, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag=false)
#define DXLE_GET_LOCK(mtx)
screen & draw_on_this(Func_T &&draw_func)
static int GetTextureRawHandle(const texture2d &)
#define DXLE_NOEXCEPT_IF(COND)
int filter_bright_clip(bright_clip_mode clipmode, uint8_t clip_pram, unsigned int fillcolor, uint8_t fillalpha)
int filter_down_scale(uint8_t DivNum)
tstring GetGraphFilePath() const
グラフィックが画像ファイルから読み込まれていた場合、その画像のファイルパスを取得する ...
DXLE_CONSTEXPR static_derivative_texture2d() DXLE_NOEXCEPT_OR_NOTHROW
#define DXLE_NOEXCEPT_OR_NOTHROW
derivative_texture2d LoadDivGraph(const tstring &FileName, int AllNum, const dxle::sizei &Num, const dxle::sizei &Size, bool NotUse3DFlag)
画像ファイルを分割してグラフィックハンドルを作成する
int filter_gaussian(uint16_t PixelWidth, int Param)
bright_clip_mode
for filter_bright_clip(texture2d and screen_c )
virtual std::unique_ptr< texture2d > clone() const
画像を複製する