2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/images/encoded-buffer-image.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/common/dali-common.h>
24 #include <dali/internal/common/image-attributes.h>
25 #include <dali/internal/event/images/encoded-buffer-image-impl.h>
30 EncodedBufferImage::EncodedBufferImage()
34 EncodedBufferImage::EncodedBufferImage(Internal::EncodedBufferImage* internal)
39 EncodedBufferImage EncodedBufferImage::New( const uint8_t * const encodedImage, const std::size_t encodedImageByteCount )
41 ImageDimensions size(0, 0);
42 FittingMode::Type fittingMode = FittingMode::DEFAULT;
43 SamplingMode::Type samplingMode = SamplingMode::DEFAULT;
44 Internal::EncodedBufferImagePtr internal = Internal::EncodedBufferImage::New( encodedImage, encodedImageByteCount, size, fittingMode, samplingMode, true );
45 EncodedBufferImage image( internal.Get() );
49 EncodedBufferImage EncodedBufferImage::New( const uint8_t * const encodedImage,
50 std::size_t encodedImageByteCount,
51 ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode,
52 bool orientationCorrection )
54 Internal::EncodedBufferImagePtr internal = Internal::EncodedBufferImage::New( encodedImage, encodedImageByteCount, size, fittingMode, samplingMode, orientationCorrection );
55 EncodedBufferImage image(internal.Get());
59 EncodedBufferImage EncodedBufferImage::DownCast( BaseHandle handle )
61 return EncodedBufferImage( dynamic_cast<Dali::Internal::EncodedBufferImage*>(handle.GetObjectPtr()) );
64 EncodedBufferImage::~EncodedBufferImage()
68 EncodedBufferImage::EncodedBufferImage( const EncodedBufferImage& handle )
73 EncodedBufferImage& EncodedBufferImage::operator=( const EncodedBufferImage& rhs )
75 BaseHandle::operator=(rhs);