From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp | 124 ++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp (limited to 'mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp') diff --git a/mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp b/mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp new file mode 100644 index 00000000..db4a3288 --- /dev/null +++ b/mpeglib/lib/util/render/dither2YUV/dither2YUV.cpp @@ -0,0 +1,124 @@ +/* + this class dithery RGB picture to yuv12 + Copyright (C) 2000 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + +#include "dither2YUV.h" + +#include + +using namespace std; + + +Dither2YUV::Dither2YUV() { + + + lmmx=mm_support(); + +} + + +Dither2YUV::~Dither2YUV(){ +} + + + + + + +void Dither2YUV::doDither(YUVPicture* pic,int depth,int ditherSize, + unsigned char* dest,int offset) { + + int inputType=pic->getImageType(); + + switch(inputType) { + case PICTURE_RGB: + doDitherRGB_NORMAL(pic,depth,ditherSize,dest,offset); + break; + default: + std::cout << "unknown RGB type:"<getHeight(); + int w=rgbPic->getWidth(); + int lumLength=w * h; + int colorLength=(w * h) / 4; + + unsigned char* lum=dest; + unsigned char* cr=lum+lumLength; + unsigned char* cb=cr+colorLength; + unsigned char* rgbSource=rgbPic->getImagePtr(); + + + switch (depth) { + case 8: + std::cout << "8 bit dither to yuv not supported"<