-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add separate api and private/unit test executables
Related: #94 We need a separate executables for: (1) the public (possibly shared) ACF api (2) the private support class/functions used internally in ACF that require focused testing * add SIMD channel conversion code to ACF (imgrated from drishti) and to private unit test * move optimized separable triangle filter shader test to private unit test * extract ogles_gpgpu::ACF::getImage() texture read code to acf/transfer.{h,cpp} as stand-alone functions for easier reuse (without require compilatino of GPUACF.{h,cpp} * collect private unit test sources with sugar in ACF_TEST_SRCS variable and build into the acf unit test executable
- Loading branch information
1 parent
47f1ed1
commit ab42668
Showing
14 changed files
with
1,059 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*! -*-c++-*- | ||
@file transfer.cpp | ||
@author David Hirvonen | ||
@brief Implementation of gpu->cpu transfer routines. | ||
\copyright Copyright 2018 Elucideye, Inc. All rights reserved. | ||
\license{This project is released under the 3 Clause BSD License.} | ||
*/ | ||
|
||
#include <acf/transfer.h> | ||
#include <ogles_gpgpu/common/gl/memtransfer_optimized.h> | ||
#include <ogles_gpgpu/common/proc/base/procinterface.h> | ||
|
||
BEGIN_OGLES_GPGPU | ||
|
||
cv::Mat getImage(ProcInterface& proc, cv::Mat& frame) | ||
{ | ||
if (dynamic_cast<MemTransferOptimized*>(proc.getMemTransferObj())) | ||
{ | ||
MemTransfer::FrameDelegate delegate = [&](const Size2d& size, const void* pixels, size_t bytesPerRow) { | ||
frame = cv::Mat(size.height, size.width, CV_8UC4, const_cast<void*>(pixels), bytesPerRow).clone(); | ||
}; | ||
proc.getResultData(delegate); | ||
} | ||
else | ||
{ | ||
frame.create(proc.getOutFrameH(), proc.getOutFrameW(), CV_8UC4); // noop if preallocated | ||
proc.getResultData(frame.ptr()); | ||
} | ||
return frame; | ||
} | ||
|
||
cv::Mat getImage(ProcInterface& proc) | ||
{ | ||
cv::Mat frame; | ||
return getImage(proc, frame); | ||
} | ||
|
||
END_OGLES_GPGPU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*! -*-c++-*- | ||
@file transfer.h | ||
@author David Hirvonen | ||
@brief Declaration of gpu->cpu transfer routines. | ||
\copyright Copyright 2018 Elucideye, Inc. All rights reserved. | ||
\license{This project is released under the 3 Clause BSD License.} | ||
*/ | ||
|
||
#ifndef __acf_transfer_h__ | ||
#define __acf_transfer_h__ | ||
|
||
#include <opencv2/core.hpp> | ||
#include <ogles_gpgpu/common/proc/base/procinterface.h> | ||
|
||
BEGIN_OGLES_GPGPU | ||
|
||
cv::Mat getImage(ProcInterface& proc); | ||
cv::Mat getImage(ProcInterface& proc, cv::Mat& frame); | ||
|
||
END_OGLES_GPGPU | ||
|
||
#endif // __acf_transfer_h__ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sugar_include(lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.