Merge pull request #20857 from alexgiving:atrutnev/move_API_samples

Move API sample code to tutorial_code location
This commit is contained in:
Trutnev Aleksei 2021-11-12 17:17:21 +03:00 committed by GitHub
parent 45f18eaa52
commit b525480b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 22 additions and 22 deletions

View File

@ -47,7 +47,7 @@ an external parameter.
G-API provides a macro to define a new kernel interface --
G_TYPED_KERNEL():
@snippet modules/gapi/samples/kernel_api_snippets.cpp filter2d_api
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp filter2d_api
This macro is a shortcut to a new type definition. It takes three
arguments to register a new type, and requires type body to be present
@ -81,18 +81,18 @@ Once a kernel is defined, it can be used in pipelines with special,
G-API-supplied method "::on()". This method has the same signature as
defined in kernel, so this code:
@snippet modules/gapi/samples/kernel_api_snippets.cpp filter2d_on
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp filter2d_on
is a perfectly legal construction. This example has some verbosity,
though, so usually a kernel declaration comes with a C++ function
wrapper ("factory method") which enables optional parameters, more
compact syntax, Doxygen comments, etc:
@snippet modules/gapi/samples/kernel_api_snippets.cpp filter2d_wrap
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp filter2d_wrap
so now it can be used like:
@snippet modules/gapi/samples/kernel_api_snippets.cpp filter2d_wrap_call
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp filter2d_wrap_call
# Extra information {#gapi_kernel_supp_info}
@ -143,7 +143,7 @@ For example, the aforementioned `Filter2D` is implemented in
"reference" CPU (OpenCV) plugin this way (*NOTE* -- this is a
simplified form with improper border handling):
@snippet modules/gapi/samples/kernel_api_snippets.cpp filter2d_ocv
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp filter2d_ocv
Note how CPU (OpenCV) plugin has transformed the original kernel
signature:
@ -174,7 +174,7 @@ point extraction to an STL vector:
A compound kernel _implementation_ can be defined using a generic
macro GAPI_COMPOUND_KERNEL():
@snippet modules/gapi/samples/kernel_api_snippets.cpp compound
@snippet samples/cpp/tutorial_code/gapi/doc_snippets/kernel_api_snippets.cpp compound
<!-- TODO: ADD on how Compound kernels may simplify dispatching -->
<!-- TODO: Add details on when expand() is called! -->

View File

@ -171,7 +171,7 @@ using GRunArgs = std::vector<GRunArg>;
* It's an ordinary overload of addition assignment operator.
*
* Example of usage:
* @snippet modules/gapi/samples/dynamic_graph.cpp GRunArgs usage
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/dynamic_graph_snippets.cpp GRunArgs usage
*
*/
inline GRunArgs& operator += (GRunArgs &lhs, const GRunArgs &rhs)
@ -223,7 +223,7 @@ using GRunArgsP = std::vector<GRunArgP>;
* It's an ordinary overload of addition assignment operator.
*
* Example of usage:
* @snippet modules/gapi/samples/dynamic_graph.cpp GRunArgsP usage
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/dynamic_graph_snippets.cpp GRunArgsP usage
*
*/
inline GRunArgsP& operator += (GRunArgsP &lhs, const GRunArgsP &rhs)
@ -247,7 +247,7 @@ namespace gapi
* it needs to be wrapped by this function.
*
* Example of usage:
* @snippet modules/gapi/samples/api_ref_snippets.cpp bind after deserialization
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp bind after deserialization
*
* @param out_args deserialized GRunArgs.
* @return the same GRunArgs wrapped in GRunArgsP.
@ -260,7 +260,7 @@ GAPI_EXPORTS cv::GRunArgsP bind(cv::GRunArgs &out_args);
* which this function does.
*
* Example of usage:
* @snippet modules/gapi/samples/api_ref_snippets.cpp bind before serialization
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp bind before serialization
*
* @param out output GRunArgsP available during graph execution.
* @return the same GRunArgsP wrapped in serializable GRunArgs.

View File

@ -134,12 +134,12 @@ namespace detail {
*
* For example, if an example computation is executed like this:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp graph_decl_apply
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp graph_decl_apply
*
* Extra parameter specifying which kernels to compile with can be
* passed like this:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp apply_with_param
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp apply_with_param
*/
/**

View File

@ -61,11 +61,11 @@ namespace s11n {
* executed. The below example expresses calculation of Sobel operator
* for edge detection (\f$G = \sqrt{G_x^2 + G_y^2}\f$):
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp graph_def
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp graph_def
*
* Full pipeline can be now captured with this object declaration:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp graph_cap_full
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp graph_cap_full
*
* Input/output data objects on which a call graph should be
* reconstructed are passed using special wrappers cv::GIn and
@ -78,7 +78,7 @@ namespace s11n {
* expects that image gradients are already pre-calculated may be
* defined like this:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp graph_cap_sub
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp graph_cap_sub
*
* The resulting graph would expect two inputs and produce one
* output. In this case, it doesn't matter if gx/gy data objects are
@ -130,7 +130,7 @@ public:
* Graph can be defined in-place directly at the moment of its
* construction with a lambda:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp graph_gen
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp graph_gen
*
* This may be useful since all temporary objects (cv::GMats) and
* namespaces can be localized to scope of lambda, without

View File

@ -659,7 +659,7 @@ namespace gapi {
* Use this function to pass kernel implementations (defined in
* either way) and transformations to the system. Example:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp kernels_snippet
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp kernels_snippet
*
* Note that kernels() itself is a function returning object, not
* a type, so having `()` at the end is important -- it must be a

View File

@ -71,7 +71,7 @@ public:
* It's an ordinary overload of addition assignment operator.
*
* Example of usage:
* @snippet modules/gapi/samples/dynamic_graph.cpp GIOProtoArgs usage
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/dynamic_graph_snippets.cpp GIOProtoArgs usage
*
*/
template<typename Tg>

View File

@ -88,7 +88,7 @@ public:
* This constructor overload is not marked `explicit` and can be
* used in G-API expression code like this:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp gscalar_implicit
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp gscalar_implicit
*
* Here operator+(GMat,GScalar) is used to wrap cv::gapi::addC()
* and a value-initialized GScalar is created on the fly.

View File

@ -57,7 +57,7 @@ namespace detail
*
* Refer to the following example. Regular (untyped) code is written this way:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp Untyped_Example
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp Untyped_Example
*
* Here:
*
@ -71,7 +71,7 @@ namespace detail
*
* Now the same code written with typed API:
*
* @snippet modules/gapi/samples/api_ref_snippets.cpp Typed_Example
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp Typed_Example
*
* The key difference is:
*

View File

@ -40,7 +40,7 @@ struct NotImplemented {
* which can be utilized when serializing a custom type.
*
* Example of usage:
* @snippet modules/gapi/samples/api_ref_snippets.cpp S11N usage
* @snippet samples/cpp/tutorial_code/gapi/doc_snippets/api_ref_snippets.cpp S11N usage
*
*/
template<typename T>