#include "Pixel.cuh"

////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
/*
	Pixel CLASS CASE
*/
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////


__device__ Pixel::Pixel() :
	R(NULL),
	G(NULL),
	B(NULL),
	color_range(255)
{
	//Nothing here
}

__device__  Pixel::Pixel(const unsigned char R, const unsigned char G, const unsigned char B) :
	R(R),
	G(G),
	B(B),
	color_range(255)
{
	//Nothing here
}

__device__  Pixel::Pixel(const Pixel& Object) :
	R(Object.R),
	G(Object.G),
	B(Object.B),
	color_range(Object.color_range)
{
	//Nothing here
}

__device__ void Pixel::Show_Object() const
{
	//_STD cout << "Red: [" << static_cast<int>(this->R) << " ] " << "Green: [" << static_cast<int>(this->G) << " ] " << "Blue: [" << static_cast<int>(this->B) << " ] " << "Color range: " << this->color_range << NEW_LINE;
	printf("RED [%d] GREEN [%d] BLUE [%d]", static_cast<int>(this->R), static_cast<int>(this->G), static_cast<int>(this->B));
}

__device__ void Pixel::Set_R(const unsigned char R)
{
	this->R = R;
}

__device__ void Pixel::Set_G(const unsigned char G)
{
	this->G = G;
}

__device__ void Pixel::Set_B(const unsigned char B)
{
	this->B = B;
}

__device__  void Pixel::Set_Color_Range(const int Color_Range)
{
	this->color_range = Color_Range;
}

__device__ const unsigned char Pixel::Get_R() const
{
	return this->R;
}

__device__ const unsigned char Pixel::Get_G() const
{
	return this->G;
}

__device__ const unsigned char Pixel::Get_B() const
{
	return this->B;
}

__device__ const int Pixel::Get_Color_Range() const
{
	return this->color_range;
}

__device__ Pixel& Pixel::operator=(const Pixel& Object)
{
	//if (this != _STD addressof(Object))
	if (this != &Object)
	{
		this->R = Object.R;
		this->G = Object.G;
		this->B = Object.B;
		this->color_range = Object.color_range;
	}
	return *this;
}

__device__ Pixel::~Pixel()
{
	this->R = NULL;
	this->G = NULL;
	this->B = NULL;
	this->color_range = NULL;
}


////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
	.file	"tmpxft_00207154_00000000-6_Pixel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.align 2
	.globl	_ZN5PixelD2Ev
	.type	_ZN5PixelD2Ev, @function
_ZN5PixelD2Ev:
.LFB3655:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movq	%rax, -16(%rsp)
	movq	-16(%rsp), %rdi
	jmp	free@PLT
	.cfi_endproc
.LFE3655:
	.size	_ZN5PixelD2Ev, .-_ZN5PixelD2Ev
	.globl	_ZN5PixelD1Ev
	.set	_ZN5PixelD1Ev,_ZN5PixelD2Ev
	.align 2
	.globl	_ZN5PixelD0Ev
	.type	_ZN5PixelD0Ev, @function
_ZN5PixelD0Ev:
.LFB3657:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, 8(%rsp)
	call	_ZN5PixelD1Ev
	movq	8(%rsp), %rdi
	movl	$16, %esi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
	.cfi_endproc
.LFE3657:
	.size	_ZN5PixelD0Ev, .-_ZN5PixelD0Ev
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3660:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3660:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.globl	_ZN5PixelC2Ev
	.type	_ZN5PixelC2Ev, @function
_ZN5PixelC2Ev:
.LFB3636:
	.cfi_startproc
	endbr64
	leaq	16+_ZTV5Pixel(%rip), %rax
	movl	$-16777216, 8(%rdi)
	movq	%rax, (%rdi)
	xorl	%eax, %eax
	movq	%rax, -16(%rsp)
	movq	-16(%rsp), %rdi
	jmp	free@PLT
	.cfi_endproc
.LFE3636:
	.size	_ZN5PixelC2Ev, .-_ZN5PixelC2Ev
	.globl	_ZN5PixelC1Ev
	.set	_ZN5PixelC1Ev,_ZN5PixelC2Ev
	.align 2
	.globl	_ZN5PixelC2Ehhh
	.type	_ZN5PixelC2Ehhh, @function
_ZN5PixelC2Ehhh:
.LFB3639:
	.cfi_startproc
	endbr64
	leaq	16+_ZTV5Pixel(%rip), %rax
	movb	%sil, 8(%rdi)
	movq	%rax, (%rdi)
	xorl	%eax, %eax
	movb	%dl, 9(%rdi)
	movb	%cl, 10(%rdi)
	movb	$-1, 11(%rdi)
	movq	%rax, -16(%rsp)
	movq	-16(%rsp), %rdi
	jmp	free@PLT
	.cfi_endproc
.LFE3639:
	.size	_ZN5PixelC2Ehhh, .-_ZN5PixelC2Ehhh
	.globl	_ZN5PixelC1Ehhh
	.set	_ZN5PixelC1Ehhh,_ZN5PixelC2Ehhh
	.align 2
	.globl	_ZN5PixelC2ERKS_
	.type	_ZN5PixelC2ERKS_, @function
_ZN5PixelC2ERKS_:
.LFB3642:
	.cfi_startproc
	endbr64
	leaq	16+_ZTV5Pixel(%rip), %rax
	movq	%rax, (%rdi)
	movl	8(%rsi), %eax
	movl	%eax, 8(%rdi)
	xorl	%eax, %eax
	movq	%rax, -16(%rsp)
	movq	-16(%rsp), %rdi
	jmp	free@PLT
	.cfi_endproc
.LFE3642:
	.size	_ZN5PixelC2ERKS_, .-_ZN5PixelC2ERKS_
	.globl	_ZN5PixelC1ERKS_
	.set	_ZN5PixelC1ERKS_,_ZN5PixelC2ERKS_
	.align 2
	.globl	_ZNK5Pixel11Show_ObjectEv
	.type	_ZNK5Pixel11Show_ObjectEv, @function
_ZNK5Pixel11Show_ObjectEv:
.LFB3644:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3644:
	.size	_ZNK5Pixel11Show_ObjectEv, .-_ZNK5Pixel11Show_ObjectEv
	.align 2
	.globl	_ZN5Pixel5Set_REh
	.type	_ZN5Pixel5Set_REh, @function
_ZN5Pixel5Set_REh:
.LFB3645:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3645:
	.size	_ZN5Pixel5Set_REh, .-_ZN5Pixel5Set_REh
	.align 2
	.globl	_ZN5Pixel5Set_GEh
	.type	_ZN5Pixel5Set_GEh, @function
_ZN5Pixel5Set_GEh:
.LFB4306:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZN5Pixel5Set_REh
	.cfi_endproc
.LFE4306:
	.size	_ZN5Pixel5Set_GEh, .-_ZN5Pixel5Set_GEh
	.align 2
	.globl	_ZN5Pixel5Set_BEh
	.type	_ZN5Pixel5Set_BEh, @function
_ZN5Pixel5Set_BEh:
.LFB4308:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZN5Pixel5Set_REh
	.cfi_endproc
.LFE4308:
	.size	_ZN5Pixel5Set_BEh, .-_ZN5Pixel5Set_BEh
	.align 2
	.globl	_ZN5Pixel15Set_Color_RangeEi
	.type	_ZN5Pixel15Set_Color_RangeEi, @function
_ZN5Pixel15Set_Color_RangeEi:
.LFB3648:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3648:
	.size	_ZN5Pixel15Set_Color_RangeEi, .-_ZN5Pixel15Set_Color_RangeEi
	.align 2
	.globl	_ZNK5Pixel5Get_REv
	.type	_ZNK5Pixel5Get_REv, @function
_ZNK5Pixel5Get_REv:
.LFB3649:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3649:
	.size	_ZNK5Pixel5Get_REv, .-_ZNK5Pixel5Get_REv
	.align 2
	.globl	_ZNK5Pixel5Get_GEv
	.type	_ZNK5Pixel5Get_GEv, @function
_ZNK5Pixel5Get_GEv:
.LFB4302:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZNK5Pixel5Get_REv
	.cfi_endproc
.LFE4302:
	.size	_ZNK5Pixel5Get_GEv, .-_ZNK5Pixel5Get_GEv
	.align 2
	.globl	_ZNK5Pixel5Get_BEv
	.type	_ZNK5Pixel5Get_BEv, @function
_ZNK5Pixel5Get_BEv:
.LFB4304:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZNK5Pixel5Get_REv
	.cfi_endproc
.LFE4304:
	.size	_ZNK5Pixel5Get_BEv, .-_ZNK5Pixel5Get_BEv
	.align 2
	.globl	_ZNK5Pixel15Get_Color_RangeEv
	.type	_ZNK5Pixel15Get_Color_RangeEv, @function
_ZNK5Pixel15Get_Color_RangeEv:
.LFB3652:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3652:
	.size	_ZNK5Pixel15Get_Color_RangeEv, .-_ZNK5Pixel15Get_Color_RangeEv
	.align 2
	.globl	_ZN5PixelaSERKS_
	.type	_ZN5PixelaSERKS_, @function
_ZN5PixelaSERKS_:
.LFB3653:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3653:
	.size	_ZN5PixelaSERKS_, .-_ZN5PixelaSERKS_
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3683:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3683:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.weak	_ZTS5Pixel
	.section	.rodata._ZTS5Pixel,"aG",@progbits,_ZTS5Pixel,comdat
	.type	_ZTS5Pixel, @object
	.size	_ZTS5Pixel, 7
_ZTS5Pixel:
	.string	"5Pixel"
	.weak	_ZTI5Pixel
	.section	.data.rel.ro._ZTI5Pixel,"awG",@progbits,_ZTI5Pixel,comdat
	.align 8
	.type	_ZTI5Pixel, @object
	.size	_ZTI5Pixel, 16
_ZTI5Pixel:
	.quad	_ZTVN10__cxxabiv117__class_type_infoE+16
	.quad	_ZTS5Pixel
	.weak	_ZTV5Pixel
	.section	.data.rel.ro.local._ZTV5Pixel,"awG",@progbits,_ZTV5Pixel,comdat
	.align 8
	.type	_ZTV5Pixel, @object
	.size	_ZTV5Pixel, 32
_ZTV5Pixel:
	.quad	0
	.quad	_ZTI5Pixel
	.quad	_ZN5PixelD1Ev
	.quad	_ZN5PixelD0Ev
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#ifndef _PIXEL_CUH_
#define _PIXEL_CUH_
#pragma once

#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
//#ifndef __CUDACC__
//#define __CUDACC__
//#endif
#include <stdio.h>
#include <stdlib.h>
#include <iostream>

class Pixel
{
private:
	/*
		PRIVATE VARIABLES
	*/
	unsigned char R;
	unsigned char G;
	unsigned char B;
	unsigned char color_range;
	//////////////////////////////////////////////////////////////////////////////
protected:
	/*
		PROTECTED VARIABLES
	*/

	//////////////////////////////////////////////////////////////////////////////
public:
	/*
		KONSTRUKTORY
	*/
	__device__ Pixel();
	__device__ explicit Pixel(const unsigned char R, const unsigned char G, const unsigned char B);
	__device__ Pixel(const Pixel& Object);
	//////////////////////////////////////////////////////////////////////////////
	/*
		FUNKCJE PUBLIC
	*/
	__device__ void Show_Object() const;
	//////////////////////////////////////////////////////////////////////////////
	/*
		SETTERY
	*/
	__device__ void Set_R(const unsigned char R);
	__device__ void Set_G(const unsigned char G);
	__device__ void Set_B(const unsigned char B);
	__device__ void Set_Color_Range(const int Color_Range);
	//////////////////////////////////////////////////////////////////////////////
	/*
		GETTERY
	*/
	__device__ const unsigned char Get_R() const;
	__device__ const unsigned char Get_G() const;
	__device__ const unsigned char Get_B() const;
	__device__ const int Get_Color_Range() const;
	//////////////////////////////////////////////////////////////////////////////
	/*
		OPERATORY
	*/
	//JEDNOARGUMENTOWE
	__device__ Pixel& operator=(const Pixel& Object);
	//////////////////////////////////////////////////////////////////////////////
	/*
		DESTRUKTOR
	*/
	__device__ virtual ~Pixel();
	//////////////////////////////////////////////////////////////////////////////
};
#endif /* _PIXEL_CUH_ */
	.text
	.file	"Pixel.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
