Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
652e3d2d
Kaydet (Commit)
652e3d2d
authored
Agu 09, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
save texture to file as a PNG image
Change-Id: I5605b80f95d89599efe58cf65e1ce3f3581d401f
üst
8657e379
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
texture.hxx
vcl/inc/opengl/texture.hxx
+3
-1
texture.cxx
vcl/opengl/texture.cxx
+22
-1
No files found.
vcl/inc/opengl/texture.hxx
Dosyayı görüntüle @
652e3d2d
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <GL/glew.h>
#include <GL/glew.h>
#include <vcl/dllapi.h>
#include <vcl/dllapi.h>
#include <vcl/salgtype.hxx>
#include <vcl/salgtype.hxx>
#include <rtl/ustring.hxx>
#include <tools/gen.hxx>
#include <tools/gen.hxx>
class
ImplOpenGLTexture
class
ImplOpenGLTexture
...
@@ -71,6 +71,8 @@ public:
...
@@ -71,6 +71,8 @@ public:
void
Unbind
();
void
Unbind
();
void
Read
(
GLenum
nFormat
,
GLenum
nType
,
sal_uInt8
*
pData
);
void
Read
(
GLenum
nFormat
,
GLenum
nType
,
sal_uInt8
*
pData
);
void
SaveToFile
(
const
OUString
&
rFileName
);
GLenum
GetFilter
()
const
;
GLenum
GetFilter
()
const
;
void
SetFilter
(
GLenum
nFilter
);
void
SetFilter
(
GLenum
nFilter
);
...
...
vcl/opengl/texture.cxx
Dosyayı görüntüle @
652e3d2d
...
@@ -23,7 +23,8 @@
...
@@ -23,7 +23,8 @@
#include "svdata.hxx"
#include "svdata.hxx"
#include "vcl/salbtype.hxx"
#include <vcl/salbtype.hxx>
#include <vcl/pngwrite.hxx>
#include "opengl/framebuffer.hxx"
#include "opengl/framebuffer.hxx"
#include "opengl/texture.hxx"
#include "opengl/texture.hxx"
...
@@ -262,6 +263,26 @@ void OpenGLTexture::Unbind()
...
@@ -262,6 +263,26 @@ void OpenGLTexture::Unbind()
CHECK_GL_ERROR
();
CHECK_GL_ERROR
();
}
}
void
OpenGLTexture
::
SaveToFile
(
const
OUString
&
rFileName
)
{
std
::
vector
<
sal_uInt8
>
pBuffer
(
GetWidth
()
*
GetHeight
()
*
4
);
Read
(
GL_BGRA
,
GL_UNSIGNED_BYTE
,
pBuffer
.
data
());
BitmapEx
aBitmap
=
OpenGLHelper
::
ConvertBGRABufferToBitmapEx
(
pBuffer
.
data
(),
GetWidth
(),
GetHeight
());
try
{
vcl
::
PNGWriter
aWriter
(
aBitmap
);
SvFileStream
sOutput
(
rFileName
,
StreamMode
::
WRITE
);
aWriter
.
Write
(
sOutput
);
sOutput
.
Close
();
}
catch
(...)
{
SAL_WARN
(
"vcl.opengl"
,
"Error writing png to "
<<
rFileName
);
}
CHECK_GL_ERROR
();
}
void
OpenGLTexture
::
Read
(
GLenum
nFormat
,
GLenum
nType
,
sal_uInt8
*
pData
)
void
OpenGLTexture
::
Read
(
GLenum
nFormat
,
GLenum
nType
,
sal_uInt8
*
pData
)
{
{
if
(
mpImpl
==
NULL
)
if
(
mpImpl
==
NULL
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment