📄 vfakeio.cxx
字号:
/* * vfakeio.cxx * * Classes to support streaming video input (grabbing) and output. * * Portable Windows Library * * Copyright (c) 1993-2000 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Portable Windows Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Contributor(s): Derek J Smithies (derek@indranet.co.nz) * * $Log: vfakeio.cxx,v $ * Revision 1.33 2005/08/09 09:08:11 rjongbloed * Merged new video code from branch back to the trunk. * * Revision 1.32.6.3 2005/07/25 12:19:23 rjongbloed * Fixed correct device name for fake video * * Revision 1.32.6.2 2005/07/17 12:59:04 rjongbloed * Cleaned up pattern identifcation (enum) and max patterns (input channel). * * Revision 1.32.6.1 2005/07/17 09:27:08 rjongbloed * Major revisions of the PWLib video subsystem including: * removal of F suffix on colour formats for vertical flipping, all done with existing bool * working through use of RGB and BGR formats so now consistent * cleaning up the plug in system to use virtuals instead of pointers to functions. * rewrite of SDL to be a plug in compatible video output device. * extensive enhancement of video test program * * Revision 1.32 2005/01/31 08:05:41 csoutheren * More patches for MacOSX, thanks to Hannes Friederich * * Revision 1.31 2005/01/04 07:44:03 csoutheren * More changes to implement the new configuration methodology, and also to * attack the global static problem * * Revision 1.30 2004/07/11 07:56:36 csoutheren * Applied jumbo VxWorks patch, thanks to Eize Slange * * Revision 1.29 2004/03/17 22:24:29 rjongbloed * Fixed MSVC warnings * * Revision 1.28 2004/03/16 10:10:47 csoutheren * Proper fix that does not generate warnings * * Revision 1.27 2004/03/16 08:27:14 csoutheren * Removed illegal characters * * Revision 1.26 2003/12/14 10:01:02 rjongbloed * Resolved issue with name space conflict os static and virtual forms of GetDeviceNames() function. * * Revision 1.25 2003/11/19 09:29:45 csoutheren * Added super hack to avoid problems with multiple plugins in a single file * * Revision 1.24 2003/11/19 04:29:46 csoutheren * Changed to support video output plugins * * Revision 1.23 2003/08/12 22:04:18 dereksmithies * Add fix from Philippe Massicotte to fix segfaults on large images. Thanks! * * Revision 1.22 2003/06/14 03:28:50 rjongbloed * Further MSVC warning fix up * * Revision 1.21 2003/06/14 02:59:34 rjongbloed * Fixed MSVC warning. * * Revision 1.20 2003/06/11 22:17:54 dereksmithies * Add fake video device which display text, on --videoinput 5 * * Revision 1.19 2003/06/10 03:45:11 dereksmithies * Change so box on left moves all the way down left side of image. * * Revision 1.18 2003/06/10 00:36:57 dereksmithies * Formatting changes. Remove rounding errors. * * Revision 1.17 2003/06/03 04:21:49 dereksmithies * Add PTRACE statement, and tidy up format of one if statement. * * Revision 1.16 2003/03/17 07:46:49 robertj * Migrated vflip member variable and functions into PVideoDevice class. * * Revision 1.15 2002/09/23 07:17:24 robertj * Changes to allow winsock2 to be included. * * Revision 1.14 2002/01/28 21:22:10 dereks * Fix the method for returning the device name. * * Revision 1.13 2002/01/17 03:47:27 dereks * Fix latest addition to the fake images gallery. * * Revision 1.12 2002/01/16 08:02:06 robertj * MSVC compatibilty changes * * Revision 1.11 2002/01/16 03:49:23 dereks * Add new test image. * * Revision 1.10 2002/01/04 04:11:45 dereks * Add video flip code from Walter Whitlock, which flips code at the grabber. * * Revision 1.9 2001/11/28 04:39:25 robertj * Fixed MSVC warning * * Revision 1.8 2001/11/28 00:07:32 dereks * Locking added to PVideoChannel, allowing reader/writer to be changed mid call * Enabled adjustment of the video frame rate * New fictitous image, a blank grey area * * Revision 1.7 2001/03/12 03:54:11 dereks * Make setting frame rate consistent with that for real video device. * * Revision 1.6 2001/03/09 00:12:40 robertj * Fixed incorrect number of channels returned on fake video. * * Revision 1.5 2001/03/08 22:56:25 robertj * Fixed compatibility with new meaning of channelNumber variable, cannot be negative. * * Revision 1.4 2001/03/03 05:06:31 robertj * Major upgrade of video conversion and grabbing classes. * * Revision 1.3 2001/03/02 06:52:33 yurik * Got rid of unknown for WinCE pragma * * Revision 1.2 2000/12/19 23:58:14 robertj * Fixed MSVC compatibility issues. * * Revision 1.1 2000/12/19 22:20:26 dereks * Add video channel classes to connect to the PwLib PVideoInputDevice class. * Add PFakeVideoInput class to generate test images for video. * * */#define P_FORCE_STATIC_PLUGIN#include <ptlib.h>#include <ptlib/vconvert.h>#if defined(_WIN32) && !defined(P_FORCE_STATIC_PLUGIN)#error "vfakeio.cxx must be compiled without precompiled headers"#endif#include <ptlib/videoio.h>#ifdef __MACOSX__namespace PWLibStupidOSXHacks { int loadFakeVideoStuff;};#endifenum { eMovingBlocks, eMovingLine, eBouncingBoxes, eBlankImage, eOriginalMovingBlocks, eText, eNTSCTest, eNumTestPatterns};#define MAX_L_HEIGHT 11typedef struct { char ascii; char *line[MAX_L_HEIGHT];} OneVFakeLetterData;/**** * The fonts for these letters were written by Sverre H. Huseby, and have been included * in vfakeio by Derek Smithies. */static OneVFakeLetterData vFakeLetterData[] = { { ' ', { " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, { 'a', { " ", " ", " ", " **** ", " *", " *****", "* *", "* **", " *** *", " ", " " }}, { 'b', { "* ", "* ", "* ", "* *** ", "** *", "* *", "* *", "** *", "* *** ", " ", " " }}, { 'c', { " ", " ", " ", " **** ", "* *", "* ", "* ", "* *", " **** ", " ", " " }}, { 'd', { " *", " *", " *", " *** *", "* **", "* *", "* *", "* **", " *** *", " ", " " }}, { 'e', { " ", " ", " ", " **** ", "* *", "******", "* ", "* *", " **** ", " ", " " }}, { 'f', { " *** ", " * *", " * ", " * ", "**** ", " * ", " * ", " * ", " * ", " ", " " }}, { 'g', { " ", " ", " ", " *** *", "* * ", "* * ", " *** ", "* ", " **** ", "* *", " **** " }}, { 'h', { "* ", "* ", "* ", "* *** ", "** *", "* *", "* *", "* *", "* *", " ", " " }}, { 'i', { " ", " * ", " ", " ** ", " * ", " * ", " * ", " * ", "*****", " ", " " }}, { 'j', { " ", " *", " ", " **", " *", " *", " *", " *", "* *", "* *", " *** " }}, { 'k', { "* ", "* ", "* ", "* * ", "* * ", "*** ", "* * ", "* * ", "* *", " ", " " }}, { 'l', { " ** ", " * ", " * ", " * ", " * ", " * ", " * ", " * ", "*****", " ", " " }}, { 'm', { " ", " ", " ", "* * ** ", "** * *", "* * *", "* * *", "* * *", "* * *", " ", " " }}, { 'n', { " ", " ", " ", "* *** ", "** *", "* *", "* *", "* *", "* *", " ", " " }}, { 'o', { " ", " ", " ", " **** ", "* *", "* *", "* *", "* *", " **** ", " ", " " }}, { 'p', { " ", " ", " ", "* *** ", "** *", "* *", "** *", "* *** ", "* ", "* ", "* " }}, { 'q', { " ", " ", " ", " *** *", "* **", "* *", "* **", " *** *", " *", " *", " *" }}, { 'r', { " ", " ", " ", "* **", " * ", " * ", " * ", " * ", " * ", " ", " " }}, { 's', { " ", " ", " ", " **** ", "* *", " ** ", " ** ", "* *", " **** ", " ", " " }}, { 't', { " * ", " * ", " * ", "**** ", " * ", " * ", " * ", " * *", " ** ", " ", " " }}, { 'u', { " ", " ", " ", "* *", "* *", "* *", "* *", "* **", " *** *", " ", " " }}, { 'v', { " ", " ", " ", "* *", "* *", "* *", " * * ", " * * ", " * ", " ", " " }}, { 'w', { " ", " ", " ", "* *", "* *", "* * *", "* * *", "* * *", " ** ** ", " ", " " }}, { 'x', { " ", " ", " ", "* *", " * * ", " ** ", " ** ", " * * ", "* *", " ", " " }}, { 'y', { " ", " ", " ", "* *", "* *", "* *", "* **", " *** *", " *", "* *", " **** " }}, { 'z', { " ", " ", " ", "******", " * ", " * ", " * ", " * ", "******", " ", " " }}, { '\xe6', { " ", " ", " ", " ** * ", " * *", " *****", "* * ", "* * *", " ** * ", " ", " " }}, { '\xf8', { " ", " ", " *", " **** ", "* **", "* * *", "* * *", "** *", " **** ", "* ", " " }}, { '\xe5', { " ** ", " * * ", " ** ", " **** ", " *", " *****", "* *", "* **", " *** *", " ", " " }}, { 'A', { " ** ", " * * ", "* *", "* *", "* *", "******", "* *", "* *", "* *", " ", " " }}, { 'B', { "***** ", " * *", " * *", " * *", " **** ", " * *", " * *", " * *", "***** ", " ", " " }}, { 'C', { " *** ", "* *", "* ", "* ", "* ", "* ", "* ", "* *", " *** ", " ", " " }}, { 'D', { "***** ", " * *", " * *", " * *", " * *", " * *", " * *",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -