📄 pcx_provider.h
字号:
/* $Id: pcx_provider.h,v 1.9 2004/01/02 15:42:43 mbn Exp $
**
** ClanLib Game SDK
** Copyright (C) 2003 The ClanLib Team
** For a total list of contributers see the file CREDITS.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**
*/
//! clanDisplay="Surface Providers"
//! header=display.h
#ifndef header_pcx_provider
#define header_pcx_provider
#if _MSC_VER > 1000
#pragma once
#endif
#include "../pixel_buffer.h"
#include <string>
class CL_InputSourceProvider;
//: Surface provider that can load PCX files.
//- !group=Display/Surface Providers!
//- !header=display.h!
//- <p>The PCX decoder has been modified to load most PCX files
//- (instead of just the ones created by Deluxe Paint IIe).
//- It now support 1,2,4,8, or 24 bit files... and has been tested
//- in all but a few situations.</p>
//-
//- <p>Technically, the implementation cheats in that it doesnt
//- store images with less than 8 bits per pixel in their
//- native format. It simply converts them to PAL8
//- pixelformat instead of creating other pixelformats.</p>
//-
//- <p>Also note that the PCX decoder creates more bytes per
//- line than the image is supposed to contain. We rely on the clipping
//- capabilities of ClanLib to take care of that. Also note that some
//- default palettes were defined in the read_header() method. These
//- definitions might be better placed in palette.h. Since the scope of
//- the PCX_Provider rewrite was limited to the provider itself, no files
//- outside of pcx_provider.h and pcx_provider.cpp were modified.</p>
//-
//- <p>The PCX decoding code was moved to read_data() and read_header()
//- to make it easier to follow the code (called from perform_unlock()).</p>
class CL_PCXProvider : public CL_PixelBuffer
{
//! Construction:
public:
//: Constructs a surface provider that can read pcx files.
//param name: Name of the pcx file to load.
//param provider: Input source provider that delivers the pcx file.
//param transparent: True if a color in image should be transparent.
//param trans_col: Transparency color used if 'transparent' is true. Defaults to color 0.
CL_PCXProvider(
const std::string &name,
CL_InputSourceProvider *provider = 0,
bool transparent = false,
unsigned char trans_col = 0);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -