Project

General

Profile

BitmapToolkit Scol plugin
ScolConvert.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __BTK_SCOLCONVERT_H__
26#define __BTK_SCOLCONVERT_H__
27
28#include <scolPlugin.h>
29
30#ifdef _WIN32
31 #include <OS_specific/windows/Objstr.h>
32#else
33
34#endif
35#include <opencv2/opencv.hpp>
36
41{
42public:
43protected:
44private:
45
46public:
49 static void ScolBitmapToMatRGB(PtrObjBitmap scolBitmap, cv::Mat &mat);
50 static void ScolBitmapToMatRGBA(PtrObjBitmap scolBitmap, PtrObjBitmap scolBitmap8, cv::Mat &mat);
51
54 static void MatToScolBitmapRGB(cv::Mat mat, PtrObjBitmap scolBitmap);
55 static void MatToScolBitmapBGR(cv::Mat mat, PtrObjBitmap scolBitmap);
56 static void MatToScolBitmapRGBA(cv::Mat mat, PtrObjBitmap scolBitmap, PtrObjBitmap scolBitmap8);
57
58 static void Blend(cv::Mat& base, const cv::Mat& top, float mix);
59 static void Blend(cv::Mat& base, cv::Mat& abase, const cv::Mat& top, const cv::Mat& atop, float mix);
60 static int GetScolBitmapAlignment(int width, int nbcomponents);
61 static cv::Mat ScolBitmapToMat(PtrObjBitmap scolBitmap);
62 static cv::Mat ScolBitmapBufferToMat(void* buffer, int width, int height, int nbcomponents, bool align = true);
63 static bool ClipBitmapRect(const cv::Mat src, cv::Rect &srect, const cv::Mat dst, cv::Rect &drect);
64
65protected:
66private:
71};
72
73#endif
static cv::Mat ScolBitmapBufferToMat(void *buffer, int width, int height, int nbcomponents, bool align=true)
static void Blend(cv::Mat &base, const cv::Mat &top, float mix)
static void ScolBitmapToMatRGBA(PtrObjBitmap scolBitmap, PtrObjBitmap scolBitmap8, cv::Mat &mat)
static cv::Mat ScolBitmapToMat(PtrObjBitmap scolBitmap)
static void ScolBitmapToMatRGB(PtrObjBitmap scolBitmap, cv::Mat &mat)
static void MatToScolBitmapBGR(cv::Mat mat, PtrObjBitmap scolBitmap)
static void MatToScolBitmapRGB(cv::Mat mat, PtrObjBitmap scolBitmap)
static bool ClipBitmapRect(const cv::Mat src, cv::Rect &srect, const cv::Mat dst, cv::Rect &drect)
static void MatToScolBitmapRGBA(cv::Mat mat, PtrObjBitmap scolBitmap, PtrObjBitmap scolBitmap8)
static int GetScolBitmapAlignment(int width, int nbcomponents)