2
writes yuv images on HD
3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
14
#include "yuvDumper.h"
16
YUVDumper::YUVDumper() {
18
method=_DUMP_YUV_AS_STREAM;
21
YUVDumper::~YUVDumper() {
25
int YUVDumper::openWindow(int w, int h,const char*) {
27
FILE* formatFile=fopen("stream.yuv.format","w+");
28
fprintf(formatFile,"Version 0.1\nw:%dh:%d\n",w,h);
33
if (method == _DUMP_YUV_AS_STREAM) {
34
FILE* outFile=fopen("stream.yuv","w+");
40
void YUVDumper::closeWindow() {
44
void YUVDumper::flushWindow() {
48
int YUVDumper::getMethod() {
53
void YUVDumper::setMethod(int method) {
57
void YUVDumper::unlockPictureArray(PictureArray* pictureArray) {
58
YUVPicture* pic=pictureArray->getYUVPictureCallback();
65
if (method == _DUMP_YUV_AS_STREAM) {
66
outFile=fopen("stream.yuv","a+");
69
if (outFile == NULL) {
74
int lumSize=pic->getLumLength();
75
int colorSize=pic->getColorLength();
76
fwrite(pic->getLuminancePtr(),1,lumSize,outFile);
77
fwrite(pic->getCrPtr(),1,colorSize,outFile);
78
fwrite(pic->getCbPtr(),1,colorSize,outFile);