Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

RawEncoder.cxx 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. #include <rdr/OutStream.h>
  19. #include <rfb/encodings.h>
  20. #include <rfb/SMsgWriter.h>
  21. #include <rfb/SConnection.h>
  22. #include <rfb/PixelBuffer.h>
  23. #include <rfb/RawEncoder.h>
  24. using namespace rfb;
  25. RawEncoder::RawEncoder(SConnection* conn) : Encoder(conn)
  26. {
  27. }
  28. RawEncoder::~RawEncoder()
  29. {
  30. }
  31. void RawEncoder::writeRect(const Rect& r, PixelBuffer* pb)
  32. {
  33. rdr::U8* buf = conn->writer()->getImageBuf(r.area());
  34. pb->getImage(conn->cp.pf(), buf, r);
  35. conn->writer()->startRect(r, encodingRaw);
  36. conn->getOutStream()->writeBytes(buf, r.area() * conn->cp.pf().bpp/8);
  37. conn->writer()->endRect();
  38. }