Dali 3D User Interface Engine
native-image-source.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 // CLASS HEADER
19 #include <native-image-source.h>
20 
21 // EXTERNAL INCLUDES
23 
24 // INTERNAL INCLUDES
25 #include <native-image-source-impl.h>
26 
27 namespace Dali
28 {
29 
31 {
32  Any empty;
33  NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
34  return image;
35 }
36 
38 {
39  return mImpl->GetNativeImageSource();
40 }
41 
43 {
44  NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
45  return image;
46 }
47 
48 bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
49 {
50  return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
51 }
52 
53 bool NativeImageSource::EncodeToFile(const std::string& filename) const
54 {
55  return mImpl->EncodeToFile(filename);
56 }
57 
59 {
60  mImpl->SetNativeImageSource( nativeImageSource );
61 }
62 
64 {
65  return mImpl->GlExtensionCreate();
66 }
67 
69 {
70  mImpl->GlExtensionDestroy();
71 }
72 
74 {
75  return mImpl->TargetTexture();
76 }
77 
79 {
80 
81 }
82 
83 unsigned int NativeImageSource::GetWidth() const
84 {
85  return mImpl->GetWidth();
86 }
87 
88 unsigned int NativeImageSource::GetHeight() const
89 {
90  return mImpl->GetHeight();
91 }
92 
94 {
95  return mImpl->RequiresBlending();
96 }
97 
99 {
100  return mImpl->GetNativeImageInterfaceExtension();
101 }
102 
103 NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
104 {
105  mImpl = Internal::Adaptor::NativeImageSource::New( width, height, depth, nativeImageSource );
106 }
107 
109 {
110  delete mImpl;
111 }
112 
113 } // namespace Dali
Dali Docs Home
Read more about Dali